Support dropdown with multiple value in Redash, plus ALL value
09/09/2021
Redash
In Redash, there is a big demand for dropdown with ALL value. However, it’s tricky to write where statement for ALL value. This post is all about work-around this issue.
Thank for my colleague - Trieu. All Credit to him.
The dropdown configuration is in the following image.
In the where section, condition statement should look like this one
(column_name in (SELECT unnest(CONCAT('{', '{{ redash_var_name }}', '}')::varchar[])) OR '{{ redash_var_name }}' LIKE '%ALL%')
example:
(dh.importer_name in (SELECT unnest(CONCAT('{', '{{ importer_name }}', '}')::varchar[])) OR '{{ importer_name }}' LIKE '%ALL%')In the script above, it cast to varchar[], if column typed uuid, change the casted type to ::uuid[]
And It’s all done, you are ready to go!