Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Apply filter condition dynamically

sbatra116
8 - Asteroid

can't find the solution, i'm sure it has to be simple. 

 

dataset/table has the filter in a column that needs to be applied to every row.

 

Apply the filter on days column. both filter and data exists in same table.

 

condition for first row will look like:  is days >5.  depending upon output the result column should be populated with YES/NO 

same for the other rows.

 

i was trying to use the dynamic replace but its messing up the result set. 

 

 

IDDaysFIlterResult
110>5 
226>5 
35=1 

 

 

output 

IDDaysFIlterResult
110>5YES
226>5YES
35=1NO

 

3 REPLIES 3
ArtApa
Alteryx
Alteryx

Hi @sbatra116 - You may do a formula first and then a filter:

ArtApa_0-1668403846083.png

 

ShankerV
17 - Castor

Hi @sbatra116 

 

One way of doing this, 

1. Have the input tool with ID and Days

2. Have the formula tool 

Output column - Remane as Filter

Condition 

if ([days]>5)
then ">5"
else "=1"
endif

 

In the same formula tool, use the + button to create new one.

Output column - Remane as Result

if ([Filter] = ">5")
then "YES"
else "No"
endif

 

This will fetch the same output you are looking for.

 

Note: Due to limitations not able to attach the workflow or any screenshot

Let me know if you need any further assistance.

 

Many thanks

Sharker V

 

KrishnaChithrathil
11 - Bolide

Hola @sbatra116 

I tried this way. But I'm sure you'll get better solution than this. 😄

KrishnaChithrathil_0-1668405733752.png

 

I suggest to update the formula accordingly. 

Good day.

 

Labels