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

Alteryx Designer Desktop Discussions

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

Creating a check column to subtract values to see if they are 0

wonka1234
10 - Fireball

Hi,

 

I want to create a column to check if the "Value" columns are the same. I cannot just subtract them as I have nulls in some columns.

 

How can I do th is?

 

 

wonka1234_1-1657723162286.png

 

 

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

What abouit replacing Nulls with zeros? You can do this with the Imputation Tool or Multi-Field Tool with expression,

 

 

if isnull([_CurrentField_]) then 0 else [_CurrentField_] endif

 

 

You probably don't want to subtract the numbers and check the result is equal to zero, as floating point arithmetic may leave some remainder, even if the numbers are essentially the same. You're better off using,

 

compareepsilon([Field1], [Field2], 0.01)

 

Where, in this case, 0.01 is the tolerance. If [Field1] and [Field2] are within this tolerance you will get True, else False.

 

lulu47408
7 - Meteor

If you want to subtract them, you can use a Data Cleansing tool to replace null with 0

wonka1234
10 - Fireball

is there a way to 4 way compare? Ive converted nulls to 0.

PhilipMannering
16 - Nebula
16 - Nebula

I don't think so. You're looking at something like,

 

([Field1] = [Field2]) and
([Field2] = [Field3]) and
([Field3] = [Field4])

...or the equivalent using the CompareEpsilon() function

 

Labels