Alteryx Designer Desktop Discussions

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

Interface Tools For String Replacement

danloz
8 - Asteroid

Hi,

 

I have an indbt connection with a indb filter.  The target field can have possible values blank OR can be populated with a value.  What I want is for my user to be able to optionally input a value pre-run and have Alteryx return only records where that value matches.  If the user does not input the value pre-run, Alteryx should return all records. 

 

  My current filter statement is:  

"FIELD" LIKE '%' or "FIELD" is null

 

I added the textbox where I would have the opportunity to "replace specific string", which I would expect to use, for example, replacing  % with %USER_INPUT  and therefore the updated filter criteria would be 

 

FIELD" LIKE '%USER_INPUT' or "FIELD" is null

 

But of course, that would still return the null records which would not be desired.  My question then becomes how can I do something a little more complex to get the desired filter statement of 

"FIELD" LIKE '%USER_INPUT' when the user provides input

or

"FIELD" LIKE '%' or "FIELD" is null when the user provides no input

 

 

3 REPLIES 3
mceleavey
17 - Castor
17 - Castor

Hi @danloz ,

 

with this you will need the search string to behave differently each time.

The best way to do this is to have two processes, each being mutually exclusive depending on the input value from the text box. If the user does not enter any text then you want null values returned, but if they enter text you want anything that contains that string. 

I've attached a basic app that shows how to achieve this. I've used the container method, by which one container searches for the term entered by the user, so if the user enters text this container will be activated, if not, this container will be switched off and the second container will be activated. The second container runs the process which will search for null values.

mceleavey_0-1680261236794.png

 

I hope this helps,

 

M.

 



Bulien

danloz
8 - Asteroid

Thanks;  it took me a bit to wrap my head around this but I have it working now!  

mceleavey
17 - Castor
17 - Castor

no problem.gif



Bulien

Labels