Don't forget to register for our panel discussion with Dean Stoecker, Amy Holland, and Mark Frisch occurring next Wednesday, June 1!

2022-05-26 Updates: Email: If you're not seeing emails be delivered from the Community, please check your spam and mark the Community emails as not junk. Thank you for your patience.

Alteryx Designer Discussions

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

Multiple fields within "Then" Statement

Rob83
7 - Meteor

Hi All,

 

This is my case, I have an IF statement that depends on one field like:

 

IF a = b then

 

ENDIF

 

I need to understand how to include multiple fields being affected by the IF when True or false happens, like:

 

IF a = b then

 Z = 1;

 Y = 2;

 W = 3;

ELSE

 Z = 8;

 Y = 9;

 W = -1;

ENDIF

 

Please take the numbers assignments as an example only. In the real scenario those values would be some strings.

 

thank you

 

2 REPLIES 2
messi007
14 - Magnetar

@Rob83,

 

I think the if statement is a good tool for this case.

I developed a simple a workflow that do this 🙂

 

messi007_0-1612888510137.png

 

Hope this helps,

Regards,

 

AngelosPachis
16 - Nebula

Hi @Rob83 ,

 

Assuming your input looks something like this

 

AngelosPachis_0-1612889820093.png

 

and you want to apply a different condition to the records that are equal to "b", then you can split the data into two streams and then apply different formulas to each stream, before bringing everything back together

 

AngelosPachis_1-1612889877718.png

 

Hope that helps, let me know if that worked for you.

 

Regards,

 

Angelos

 

Labels