Template Variables with Postgres

I have defined a template variable ‘Country’ which is successfully returning a distinct list of country names from a table.

I have created a query within a Table Panel using both versions of the Template variable as follows:

SELECT * FROM orders WHERE country = [[Country]];
SELECT * FROM orders WHERE country = $<Country>;

However, both of these are not returning any values. Manually submitting these queries in a SQL Editor correctly returns an output. I have also quoted the variables in single and double quotes to no effect. The generated SQL never replaces the template placeholder with the drop down value selected in the dashboard.

Would really appreciate your support!

Solved - Under Templating, ‘Refresh’ must be set as ‘On Dashboard Load’.

1 Like