Alteryx Designer Desktop Discussions

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

Choosing biggest deviation

CorCor
8 - Asteroid

I want to look at 2 columns and copy the value of one of those columns into a new column.

In the example, EmpGrowth and LocGrowth.

I want to compare these values - and copy over the one farthest away from "1"

For instance if one EmpGrowth = 0.998 and LocGrowth = 1, I want to display the EmpGrowth value

If EmpGrwoth is 1.1 and LocGrowth is .88, I want to display the .88

If both values are 1, then just display 1.

If the vlues are EXACTLY the same distance away from one - like 0.9 and 1.1, then display the larger (1.1)

 

I was messing around with conditional formatting, but thought someone might know a simpler way.

 

Thanks

3 REPLIES 3
CarliE
Alteryx Alumni (Retired)

Hi @CorCor 

 

Attached is a workflow that solves your issue:

CarliE_0-1655218694953.png

 

I brought in the CSV, changed the data types for emp growth and loc growth, I then took the absolute value of the formula 1-empgrowth and 1-locgrowth. After that I compared the 2 difference numbers to see which one is further away from 1, taking that value.

 

Please mark this as a solution if this solved your issue, if there needs to be changes, let me know!

 

Thanks

Carli
CorCor
8 - Asteroid

Beautiful!  Thanks so much.

 

Corey

CarliE
Alteryx Alumni (Retired)

@CorCor No problem! :)

Carli
Labels