Order By selection

I want to perform something like this:
ORDER BY {{sort_by}} {{sort_direction}}
Where I would be able to type in the variable like email, amount, name, etc. that I want to sort the data by and I could also type out either ASC or DESC as well in the field. Is that doable, since again, the simple text field doesnt do the very simple trick here

1 Like

Hi @tautvydas.valatka
That is currently not possible. Would require this PR (or something similar) gets merged:

1 Like

Just found this question googling for a solution.

Inded it does'nt work directly, but It works with a CASE WHEN statement in order by.

[[order by 
     when {{sort_by}}='evo' then evo
     when {{sort_by}}='ca_last' then ca_last
     else ca
1 Like