Hi all,
I am a newbie to retool and I am currently stuck with a query.
I have a dropdown menu with the following values:
If a user chooses "Daily" the value is ="1"
This value shall be used in my SQL query to create a flexible timerange:
select count(id),
from sales sa
WHERE sa.created_at > current_date - INTERVAL '1' DAY
And instead of using the hardcoded version of '1' I would like to substitute it with my dropdown value
However, when electing {{select1.value}} I always receive an error
select count(id),
from sales sa
WHERE sa.created_at > current_date - INTERVAL {{select1.value}} DAY (This query does not work)
Any thoughts on how to solve this problem? I appreciate all your efforts!