Display a duplicate through LOOKUP

Hi all, I donโ€™t know how to concisely put my query here, so here goes (Sorry for the lengthy description)!

Thereโ€™s a table called โ€œSurgery Logbookโ€ in my app. In it, there is a set of columns called [Surgery Title], [Specify - 1], [Specify - 2], [Specify - 3], which fetch data from a table called โ€œSurgery Listโ€. So basically they work as dependent dropdowns. When the user picks a surgery title from [Surgery Title] dropdown, then either [Specify - 1], [Specify - 2] or [Specify - 3] will appear for further specification of that surgery depending on the dropdown pattern created in the โ€œSurgery Listโ€. So this โ€œSurgery Logbookโ€ table has a lot of data pertaining to each surgery user inputs.

Now what I want is to create a few charts using the data in the โ€œSurgery Logbookโ€. I created a separate table called โ€œAnalyserโ€ for this purpose where the user gets to select which kind of chart/comparison of data he/she wants (I have created an Enum column with different choices ranging from Chart 1 to Chart 7, each chart comparing a certain variable taken from the โ€œSurgery Logbookโ€ tableโ€™s data, i.e: Surgery vs Complication Rate, Surgery vs Age Distribution etc., and when the user selects one of the Chart options, a specific chart gets created, and the user gets to decide which surgery titles that chart will contain).

So one of the charts I wanted to create was to compare surgeries and their complication rates. But I wanted the user to select which surgeries are to be compared. So I created a form for that inside the โ€œAnalyserโ€ where the user gets to input a list of surgeries. Since the best way to create a list of surgeries is by creating a โ€˜referenceโ€™ table, I created a table called โ€œMultiple Surgeriesโ€ where I again created columns called [Surgery Title], [Specify - 1], [Specify - 2], [Specify - 3] fetching the same dropdown data from the โ€œSurgery Listโ€ table as I did for the โ€œSurgery Logbookโ€, so this way, the user can really specify the surgeries he/she wants to compare. (eg: If surgery title is โ€˜Anterior Resectionโ€™, the [Specify - 1] column allows to further specify it as โ€˜Laparoscopically doneโ€™ or โ€˜done as open surgeryโ€™). Then I created a slice for the โ€œSurgery Logbookโ€, with a Row Filter Expression to filter and show only the data pertaining to the Surgery Titles and specifications user selects via that โ€œMultiple Surgeriesโ€ reference table using a LOOKUP expression. This works perfectly for me!

Only issue is, if I want to compare the same surgeryโ€™s 2 different arms (for example, Anterior resection surgeryโ€™s laparoscopy arm vs open arm), although user can create 2 rows in the โ€œMultiple Surgeriesโ€ table, 1st row with [Surgery Title]=Anterior Resection and [Specify - 1]=โ€œLaparoscopicโ€, and 2nd row with [Surgery Title]=Anterior Resection and [Specify - 1]=โ€œOpenโ€, and even if the LOOKUP expressions have been written to fetch Row 1 and Row 2 data separately in to the Slice for the Row Filter Expression, it still combines both rows together and show as a single entity - Anterior Resection in the chart, and not as 2 different Anterior Resections. Is there a way to mitigate this issue? Everything works perfectly as long as [Surgery Title] brings up different surgery titles, the problem comes only when the same surgery titleโ€™s further specifications are different.

0 2 733
2 REPLIES 2

You could use the unique row key as the lookup instead of the title, or concatenate the title and specifics to get a unique result.

Steve
Platinum 4
Platinum 4

The TL;DR response is use ANY(SELECT(...)) instead of LOOKUP().

Top Labels in this Space