Alteryx Designer Desktop Discussions

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

Dynamic Formula by looping through Excel

CodingMan
7 - Meteor

Hi Folks in Alteryx Community,

 

I was trying to apply multiple conditions to a data set to filter data. I stored my conditions in another Excel sheet. I want Alteryx to loop through that condition file, change formula based on the values in that file and then filter my data.

Capture.PNG

 

 

Here is my data, it has client ID, carrier ID and dollar amount of orders. But the condition is really complicated as shown in the picture below

Capture.PNG

 

 

The third column indicates if I want to look up the multiple of Column Increment. The fourth column indicates if I want to look up value that is less than increment.

For example, if carrier is A and MultipleOrNot = 1 and LessThanIncrement is 0. In my data, I want all carrier A records that with a dollar amount of 0.05/-0.05 or multiples of 0.05/-0.05.

 

Or, if carrier is A and MultipleOrNot = 1 and LessThanIncremrnt is 1. In my data, I want all carrier A records that with a dollar amount of 0.05/-0.05 or multiples of 0.05/-0.05 or is between -0.05 and 0.05. Then move to the next condition.

 

So basically the formula will change based on the value in MultipleOrNot and LessThanIncrement. Something like 

 

if MultipleOrNot = 1 AND LessThanIncrement =1, formula is if MOD(value, increment) =0 or value is between -increment and increment.

 

Then it will go to my data, say, if carrier = A, increment = 0.05. Then filter my data.

 

 

 

I actually asked the question before, join two tables will work perfectly. 

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Dynamic-Formula/m-p/313866

 

But now, the carrier is not unique in the rule table. Therefore, I can't join data table with rule table. I think loop through the rule table will be the only way.

Capture.PNG

 

 

 

 

 

 

What I want is a formula that can change based on the value in the rule table and then apply it to my data set to filter it.

 

Any thoughts?

 

 

10 REPLIES 10
jdunkerley79
ACE Emeritus
ACE Emeritus

I needed a string for the action tool to target and replace and I needed a valid expression for the filter tool.

 

1=1 seemed like a simple one.

Labels