Why doesn't this expression work?

Hi all,
I wrote the following expression to a virtual column as well as a real column, but it didnโ€™t work.

LOOKUP([Surgery Title],โ€œSurgery Listโ€,โ€œSurgery Titleโ€,โ€œSpecialtyโ€)

I have a table called โ€œSurgery Listโ€. It has 7 columns, [Surgery Title], [Specify - 1], [Specify - 2], [Specify - 3], [Specify - 4], [Specify - 5] and [Specialty]. I have made a large database in this โ€œSurgery Listโ€ table filling surgical titles, their specifications, and then in the [Specialty] column, specialty of each surgery (eg: anterior resection is of Lower GI specialty, Open reduction and internal fixation is of Orthopaedic specialty etc.)
There is another table called โ€œSurgery Logbookโ€ for the purpose of creating a form for the user to fill. It fetches the data from that โ€œSurgery Listโ€ table and displays them through โ€˜dependent dropdown menusโ€™. So it also has the same column arrangement as that of the โ€œSurgery Listโ€ table, but they appear as dependent dropdowns. So if I write a ValidIf expression to [Specialty] column in โ€œSurgery Logbookโ€ as

Surgery List[Specialty]

The option to select the specialty appears, but since each surgery title has only one specific specialty, only one option appears for the user to select, which is fine. But what I want is when the user selects a surgery title, the [Specialty] column in the โ€œSurgery Logbookโ€ table to automatically get filled with the [Specialty] value that is there in the โ€œSurgery Listโ€. For that, I wrote that LOOKUP expression in the โ€˜app formulaโ€™. But it didnโ€™t work. Then I created a VC and tried, still didnโ€™t work. Can anyone tell me the issue with that expression?

0 4 387
4 REPLIES 4

Steve
Platinum 5
Platinum 5

LOOKUP([_THISROW].[Surgery Title],โ€œSurgery Listโ€,โ€œSurgery Titleโ€,โ€œSpecialtyโ€)

See also: LOOKUP() (specifically, the Troubleshooting section)

Thank you very much Steve!
Could I ask for another advice from you?

Is there a possibility for me to write an expression in order to fetch the value in the column called [Specialty] from โ€œSurgery Listโ€ table in the row number decided by the following expression into the โ€œSurgery Logbookโ€ tableโ€™s Virtual Column called [Specialty]?

Yep! Modify that FILTER() expression to be a SELECT() expression instead:

FILTER("Surgery List", ...)

becomes:

SELECT(Surgery List[Specialty], ...)

then wrap SELECT() with ANY():

ANY(SELECT(...))

Great stuff! Thank you so much!

Top Labels in this Space