Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

In DB Filter - select all values unless input text has value

abell_dt
7 - Meteor

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

2 REPLIES 2
jdrummey
9 - Comet

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

 

 

abell_dt
7 - Meteor

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

Labels
Top Solution Authors