Using Field Filter outside a where clause

Hi,
I'm trying to make a drop down menu on my Dashboard ( and as i could understand the only way is to make a Field Filter )
But i would like to use it outside a where clause something like this.

 SELECT
        CASE {{MyVar}}
            WHEN ("X") THEN 1
            WHEN ("Y") THEN 2
        END AS myNewVar

And Actually i could'nt a find a way to achieve this goal, did you have any idea about that?

Hi @Virgile
You cannot do that, since {{MyVar}} would be replaced with some SQL - depending on type etc, but it could look like schema.table.column IN ("My Filter Value")
You would have to wrap it in a sub-select - something like this:

 SELECT
        CASE (select column from table where {{MyVar}} limit 1)
            WHEN ("X") THEN 1
            WHEN ("Y") THEN 2
        END AS myNewVar

Thank you @flamber
It's working pretty well.