I want to have an In DB filter not filter anything if the text input is blank. Trying to write the custom expression in the filter in db tool.
I've tried both of these but the * is treated as a string on the first one and the second. Any tips?
"Column" = '*'
.....................
IF LEN("Placeholder") = 0
SELECT *
ELSE
SELECT * WHERE "Column" = "Placeholder"
END IF
The In-DB Filter tool needs to be configured like the regular Filter tool in that the given expression needs to return a boolean True/False for each record. So your syntax will be something like this:
IF LEN("Placeholder") = 0 THEN True ELSE "Column" = "Placeholder" END IF
Jonathan
I tried using this and it still returns an error
Incorrect syntax near the keyword 'IF'.\42000 = 156
in Query: WITH "Tool239_8883" AS (select *
from "scrubbed table name") SELECT * FROM "Tool239_8883" WHERE IF LEN("Placeholder") = 0
THEN True
ELSE "Columnname" = "Placeholder"
END IF
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |