ERROR: column "error_not_selected" does not exists in

Problem

Sometimes, when using Holistics, you would see the error message like this

ERROR: column "error_not_selected" does not exists in

or

 ERROR: invalid input syntax for integer: "opt_1" LINE 6: where id = 'opt_1' ^

image

It’s mostly because of your drop-down filter select option All

image

Or when the filter is not selected
image

And be used in the query condition

SELECT *
FROM "locations"."countries"
where id = {{my_dropdown}}

Solution

To fix this, there are two approaches:

  1. Wrap the condition with [[ ]]:
SELECT *
FROM "locations"."countries"
where [[id = {{my_dropdown}}]]
  1. Or remove option All and set default option

image

Happy analyzing!

Try this where [[ table_col IN ( {{variable_name}} ) ]].