Alteryx Designer Desktop Discussions

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

Compare two columns over a threshold

BonusCup
10 - Fireball

 

Hi,

 

I have a workflow that outputs a table as shown and attached.  I would like to compare "O Count" vs "L Count" and add the 'Desired Result' column showing '1'  if either column has a value of >= 30 and the other column = 0.  Thanks for any help on this.

CountCompare.JPG

4 REPLIES 4
JosephSerpis
17 - Castor
17 - Castor

Hi @BonusCup I mocked up a workflow it matches your output apart for row 9 where L count is 23 and 0 count is 0. Let me know what you think?

BonusCup
10 - Fireball

Thanks @JosephSerpis.  Row 9 is where I'm having an issue too.  The "0" value could appear in either column sometimes so I needed to call that out but only if the other column is over 30.

JosephSerpis
17 - Castor
17 - Castor

Hi @BonusCup sorry but 23 is less than 30 so you current logic of of any column having a value of greater than 30 or either a column with 0 with produce the current result.

BonusCup
10 - Fireball

Hi @JosephSerpis.  I was able to resolve the issue I was having with an IF, ELSEIF statement.  Thanks for putting me on the right path.

 

IF [O Count] >= 30 and [L Count] = 0 then 1
ELSEIF [L Count] >= 30 and [O Count] = 0 then 1
ELSE 0
ENDIF

 

CountCompare_resolved.JPG

 

 

Labels