If else condition for running two different query

Hello , can I do if else statement for running two different query

for example

if (${level} == "all ")
----> run Query A

else

—> run Query B

is this possible using flux ? I would like to do different query based on the variable value on grafana , any thoughts ? Thank you