Page 1 of 1

Dynamic variable in a query

Posted: Fri Mar 18, 2022 1:17 pm
by jlorue
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?

Re: Dynamic variable in a query

Posted: Fri Mar 18, 2022 3:41 pm
by Lech Kulikowski
Hello,

Please check the sample report in the attachment.

Thank you.

Re: Dynamic variable in a query

Posted: Sat Mar 19, 2022 9:54 am
by jlorue
Hi Lech, it worked!!!
Thank you so much for this solution!

Re: Dynamic variable in a query

Posted: Mon Mar 21, 2022 7:58 am
by Lech Kulikowski
Hello,

You are welcome.