Pass value from query variable to a custom dashboard variable

I have created a query variable named id which returns three values Year,Month,QTR

Screenshot 2024-06-10 at 3.54.00 PM

I have created another custom variable and want to pass the value selected from the id variable to my custom variable.

But in the query inspector, the value is not getting passed.

How can I achieve it

I had the same issue when several queries were specified in a custom variable, looks like it’s not possible to use variables there.

Could you confirm that if you use query from Metric variable instead of ${Metric} in this panel everything works as expected (i.e. $id is replaced by ‘QTR’ or other selected value)?

dont use inline metric queries but rather use stored pricedures and pass the variables to the stored proc
As is that 2nd variable is unreadable and unmaintainable.

maybe use a mock table query

select 'QTR' as __text,
 'call quarterly()' as __value

from mysql doc

Stored procedures offer a significant performance advantage over ad-hoc SQL queries .