Use the Filters in the Select

Hello everyone,
I want to use the input of a filter to my select statement. If i have a drop down Filter with options “ColumnA”, “ColumnB” my code would look something like this:
SELECT
CASE WHEN Filter={user input} THEN ColumnA ELSE ColumnB END
FROM
table

If the user selects “ColumnA” on Filter, my select statement would be SELECT ColumnA FROM table
Thank you in advance

Hi @nancy
That’s not possible with Field Filter, since it generates SQL references, only with a regular Text/Number filter. You would have to do it with a sub-select, but that will be messy.
It would be a lot easier, when you had something like this:
https://github.com/metabase/metabase/issues/5245 - upvote by clicking :+1: on the first post