Alteryx Designer Desktop Discussions

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

IF multiple factors are true THEN fill with specific cell label

avavalley
7 - Meteor

Hi all,

 

IF [Unit]="9733" AND [Code]="V888" AND [Link]="9733V888" THEN [Location]="LA" AND  [Classification]="Affiliate"

 

Trying to figure out a way to create an IF THEN statement correctly in which IF (multiple factors are true) THEN (fill the corresponding cells in that row for Location and Classification with their correct labels).  If there is a formula to do this that would be very helpful.

 

Thanks

6 REPLIES 6
PhilipMannering
16 - Nebula
16 - Nebula

You need two formulae to update Location and Classification separately.

 

IF [Unit]="9733" AND [Code]="V888" AND [Link]="9733V888" THEN [Location]="LA" ELSE Null() ENDIF

 

and

 

IF [Unit]="9733" AND [Code]="V888" AND [Link]="9733V888" THEN [Classification]="Affiliate" ELSE Null() ENDIF

 

Replace the Null() with [Location] or [Classification] resepectively if you're updating fields

avavalley
7 - Meteor

Thank you, this helps! I am getting an error message saying: The field "" is not contained in the record. (Expression #1)

danilang
19 - Altair
19 - Altair

Hi @avavalley 

 

In one of the formula's you forgot to specify the column to modify

 

f.png

 

Dan

avavalley
7 - Meteor

Ok thanks, I did that and it is now putting it in the correct cell but is entering "-1" in the cell instead of "LA".  Sorry for all the questions I appreciate your help.

danilang
19 - Altair
19 - Altair

Hi @avavalley 

 

The next problems are caused by your Then actions 

 

 

THEN [Classification]="Affiliate"

 

 

The Output column that you fixed in the previous post is the target column for the action.  The proper syntax for the formula that applies the Classification column should be  

 

THEN "Affiliate"

 

Make the corresponding change in the other formula as well.

 

 

The first syntax 

THEN [Classification]="Affiliate"

actually compares the value in the Classification column for the current row with the string "Affiliate" and writes a -1 if this is true and 0 if it's false.

 

 

 

Dan

avavalley
7 - Meteor

Worked perfectly thank you!

Labels