Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

IF statement with >= using percentage

dattina2287
8 - Asteroid

hi,

 

i am new to Alteryx and trying to build a workflow that would identify a match if Column One is less than or equal to Column Two + 10%. Column 1 is amount of money a gift cost without tax/shipping and Column 2 is the amount including tax and shipping. I need to see if the two values are similar enough for me to consider them a match. 

 

i know this is wrong but i don't know how to fix it

 

if [Column 1]<=[Column 2]+10% THEN "Match" ELSE "Mismatch" ENDIF

 

I know the Fuzzy Match Tool exists but i haven't used it yet so i wasn't sure if this could be done given that the comparison is between numbers. 

 

Thank you!

4 REPLIES 4
DataNath
17 - Castor
17 - Castor

Hey @dattina2287, Alteryx doesn't recognise percentages like that so you just have to add [Column 2]*0.1 to the comparison, like so:

 

if [Column 1]<=([Column 2]+([Column 2]*0.1)) THEN "Match" ELSE "Mismatch" ENDIF

 

DataNath_0-1655848026025.png

 

dattina2287
8 - Asteroid

Thank you @DataNath ! i am almost there but am getting this error below. It seems to be working until i type in "Mismatch" and then formula colors turn black. 

 

dattina2287_0-1655914867808.png

 

dattina2287_1-1655914890963.png

 

 

DataNath
17 - Castor
17 - Castor

Hey @dattina2287, check the data type of your [Reimbursed Amt.] field and make sure it's numeric. The invalid type in operator message is usually when you're trying to apply mathematical operators to data types that aren't numeric i.e. strings.

dattina2287
8 - Asteroid

oh i should have caught that one!....it worked thanks so much @DataNath !

Labels
Top Solution Authors