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

Formula - Conditions for Differences in Values

emiafshar
8 - Asteroid

Hi there,

 

I am trying to automate my data sets e.g. if data source A is x2 of data source B - or if there is a relative difference of 0.2 etc.

 

In the image below, I would want the formula to pick up that it is double the value.

 

How can I make the highlighted formula automate these? - e.g. Zeus is double Merival so the rest of the formula would read either a) Zeus is x2 of Meriavl or b) Merival is 1/2 of Zeus.

 

Another example of an automated formula would be if my data set had a high number of the same value in Merival.

 

Thanks!

 

Alteryx Q.PNG

3 REPLIES 3
WilliamR
Alteryx
Alteryx

Hello,

in the case you mention, you can use a "in" operator to test if Merival is double or half of Zeus.

In the formula, the missing expression would be: elsif Merival/Zeus in (2,0.5) then ... else... endif

Be carreful if Zeus value can be 0, you have to filter before.

emiafshar
8 - Asteroid

Hi William, thanks for the response.

Would you be able to explain the 2,0.5 as I'm not sure I understand. I would also need to apply it to instances whereby there was a 0.2 relative diff, 0.4 relative diff etc. so understanding the logic would be very helpful!

WilliamR
Alteryx
Alteryx

One solution which can industrialize your need is to create Reference tables with the value you want to identify (either a multiple or a difference), to calculate the difference and the multiple between Zeus and Merival and to use a find and replace tool to associate the right code.

Here is a sample workflow to show you how it could be:

 

Capture.JPG

 

Labels