Dynamic variable in a query
Posted: Fri Mar 18, 2022 1:17 pm
Hi,
I have built a dashboard that has 2 pages:
- Page 1: A dashboard with table1. The first column of this table is called "ID"
- Page 2: A Dashbard with table2 (related to another SQL table). This Dashboard opens when I click on a cell of the ID column of the Page1's table (using a Custom interaction in the ID column, where I defined the parameter "ID" that has a value {Row.ID}). I use {Row.ID} to filter table2 just to extract the table2's rows related to that ID.
The question is this: is there anyway to use the {Row.ID} as a variable in query of the SQL table2? I mean something like this:
Select
table2.IDreference,
table2.description
from table2
where table2.IDreference = {Row.ID}
The option to add a filter to table2 is not useful in this case, given that table2 has +100K records. So the filter by {Row.ID} is done after it gets all this records, what takes a very long time (or time out).
How can I do that?
I have built a dashboard that has 2 pages:
- Page 1: A dashboard with table1. The first column of this table is called "ID"
- Page 2: A Dashbard with table2 (related to another SQL table). This Dashboard opens when I click on a cell of the ID column of the Page1's table (using a Custom interaction in the ID column, where I defined the parameter "ID" that has a value {Row.ID}). I use {Row.ID} to filter table2 just to extract the table2's rows related to that ID.
The question is this: is there anyway to use the {Row.ID} as a variable in query of the SQL table2? I mean something like this:
Select
table2.IDreference,
table2.description
from table2
where table2.IDreference = {Row.ID}
The option to add a filter to table2 is not useful in this case, given that table2 has +100K records. So the filter by {Row.ID} is done after it gets all this records, what takes a very long time (or time out).
How can I do that?