I have created a Grafana dashboard with filter variables enabled along with "All" option enabled. I am working on BigQuery sql query to fetch the data.
I have constructed below query to fetch the data when "All" option is selected.
SELECT count(*) AS FAILED_COUNT FROM BG_TABLE where COLUMN1 like '%'.
with the above query I am able to fetch the data when user selects "All" option from dropdown but it fails when user selects multiple options from dropdown as the query is constructed like below
SELECT count(*) AS FAILED_COUNT FROM BG_TABLE where COLUMN1 like 'COLUMN_VALUE_1','COLUMN_VALUE_2'.
So to handle multiple options, I have updated query with "in" operator as below
SELECT count(*) AS FAILED_COUNT FROM BG_TABLE where COLUMN1 in ('COLUMN_VALUE_1','COLUMN_VALUE_2')
This resolved the problem with multiple options but failed when I select "All" option as the query is constructed like below
SELECT count(*) AS FAILED_COUNT FROM BG_TABLE where COLUMN1 in ('%')
Can someone help me with the query to handle both "All" and multiple options selection.