Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Loop through multiple conditions

CodingMan
7 - 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.

6 REPLIES 6
jdunkerley79
ACE Emeritus
ACE Emeritus

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.

ThizViz
11 - Bolide

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
CodingMan
7 - 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

CodingMan
7 - 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?

jdunkerley79
ACE Emeritus
ACE Emeritus
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).
CodingMan
7 - Meteor

Thank you for your help.

Labels