FieldFilter value as query parameter

Hello All,
I’d like to ask about help with following problem. I’d like to make report with possibility to choose grouping interval (day, week, month, …) from drop down list.
So, I have created table which keeps list of supported intervals: day, week, …
I have created aslo few different views (with different intervals) on database.

Problem is with this code:

SET @parm={{var_parameter}};
if @parm = ‘hour’


because var_parameter is declared as FieldFIlter and returns list. Do you know any way to receive single value in this case?
Of course, we can create some additional GUI layer where this value will be passed as parameter to metabse, but this is not ‘clear’ solution.
We can also change type of var_parameter to text but then users have to type all text manually.


Hi @Dominik
If you are allowed to set the variable from a select, then you could do something like:
SET @parm=(SELECT column FROM table WHERE {{var_parameter}} LIMIT 1);
But you’re basically asking for this: - upvote by clicking :+1: on the first post

@flamber Thank you. You made my day :slight_smile: