Using IF Statement in Query

I am trying to graph data from a MySQL datasource. I would like to create a variable such that, for a certain value the query is a certain way, and for another value of the value, the query is different.

Basically what I want is something like and IF… ELSE… type statement, where the value of the variable is in the IF.

Is it possible to use IF in the query editor? I cannot get it to work, I assume this is because IF would normally be used in a procedure… If it is not possible, how else can I get this sort of behavior?

This doesn’t really fix my problem, I would like to use the value of the variable as a condition and then do something depending on whether or not the condition is met, I don’t want to use the variable’s value directly in the query

1 Like

I’m in the same boat. Were you able to find any workarounds?