community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Loop through multiple conditions

Meteor

Hi Guys,

 

I am trying to filter a data set based on multiple conditions. This is how the data looks likeCapture.PNG

 

 

I have 3 conditions:

 

1. If customer ID = 1 AND Order $ is multiple of 5 and less or equal to 40

2. If customer ID = 2 AND Order $ is multiple of 5 and less or equal to 60

3. If customer ID = 4 AND Order $ is 7 or -7

 

 

I know I can create 3 branches using filter tool. But I will have more conditions in the future (around 100) I don't wanna have 200 filter tools in my workflow.

 

Is there a way to filter the data condition by condition (use as less tools as possible) and put all data that meet requirements into one table?

 

Any thoughts will be appreciated.

You can do this using a Batch macro to evaluate each condition as a formula against the input data.

2018-10-19_19-05-41.png

2018-10-19_19-04-34.png

 

I've attached a sample workflow to get you started.

ACE Emeritus
ACE Emeritus

Does this help at all?

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Excel-MOD-function-in-Alteryx-to-detec...

 

@thizviz aka cbridges, Bolide
http://community.alteryx.com/t5/user/viewprofilepage/user-id/2328
Meteor

Thanks ThizViz. Now I know how to solve the multiple problem. But I also want to know how to loop through conditions. Appreciate your help

Meteor

Thank you so much. Is it possible to put all the conditions in an Excel file and let Alteryx look up the values in the Excel to change the formula?

Yes perfectly possible.

The conditions are specified in the text input. If you replace this with an input tool reading from excel it should work.

You will need to write the expressions as valid Alteryx formulae (have a look in the text input tool for some examples).
Meteor

Thank you for your help.

Labels