Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

IF statement using specific field

eddalumpines
5 - Atom

Hi,

 

Is it possible to use a specific field your table as condition in an IF statement?

Say for example, I want to evaluate the Column 1 using the  first row of Column 2 as condition?

 

Thanks in advance!

7 REPLIES 7
Thableaus
17 - Castor
17 - Castor

Hi @eddalumpines 

 

Could you please provide a sample of what you're trying to do?

 

One example of an input and a desired output.


Cheers,

BrandonB
Alteryx
Alteryx

Absolutely, here is an example:

 

conditional pic.png

 

 

TonyA
Alteryx Alumni (Retired)

I'm with @Thableaus . Not really sure what you're asking for.  @BrandonB  covered the case of using other fields in an expression as a condition. If you literally want to use a column as your condition you can do that as long as the column is a Boolean type. This is a silly example, but it shows a Boolean field (Equal_Flag) being used as a condition:

 

2019-10-01_19-36-39.png

Technically, you could use an integer and possibly some other types as conditions (0 would be false) but generally that would be considered bad practice and confusing. The attached example shows Equal_Flag as a Boolean in one case and an integer in the other.

eddalumpines
5 - Atom

Hi Thableus

 

Here is a sample.

I want to check if the absolute values in the VALUE column is greater than or equal to the cell in red box.

Is that possible?

 

 

 
danilang
19 - Altair
19 - Altair

Hi @eddalumpines 

 

There's no way in Alteryx to reference a specific cell,i.e. Row 2 Cell 1 the way you can in Excel ($A$2).  The various tools can only reference data on the current row, or in the case of the Multi row tool, current row +/- n.  

 

The way would get around this to append the value that your want to compare to to all the rows like this 

 

w.png

 

The lower filter and select target the row and column you want.  This value is then appended to each of rows so the following formula tool can use it.  The results look like this

 

r.png

 

Dan

TonyA
Alteryx Alumni (Retired)

I was going to ask for more detail but missed your comment above. @danilang nailed it. Please make sure to mark that as the solution if it is what you're looking for.

eddalumpines
5 - Atom

Hi danilang,

 

not exactly what I did but it gave a wonderful insight. thanks a lot.

 

ciao!

Labels