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

Alteryx Designer Desktop Discussions

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

If statement logic issue

eliasg
7 - Meteor

Hello,

 

I'm having a hard time trying to figure out why the following logic is not working. It's always picking up the last condition and tagging everything as not mapped. The two lines are just a sample, the whole thing is about 500 lines...

 

field 1 the out field are both vstring and acct is int

 

 

IF [field1] ='text1' AND [ACCT] ='12345' THEN 'ABC' ELSEIF
[field1] ='text2' AND [ACCT] ='67890' THEN 'DEF'
else'Not mapped' endif

 

Any input is appreciated.

 

-Elias

4 REPLIES 4
NicoleJohnson
ACE Emeritus
ACE Emeritus

If your [ACCT] field is Int, then you may just need to remove the single quotes around the '12345' and '67890' parameters, so it would look something like this:

 

IF [field1] ='text1' AND [ACCT] =12345 THEN 'ABC' ELSEIF
[field1] ='text2' AND [ACCT] =67890 THEN 'DEF'
else 'Not mapped' endif

 

Let me know if that works!

 

NJ

Kenda
16 - Nebula
16 - Nebula

Hey @eliasg! Try taking the quotes off around your Int field.

eliasg
7 - Meteor

thanks! will try that now.


@NicoleJohnson wrote:

If your [ACCT] field is Int, then you may just need to remove the single quotes around the '12345' and '67890' parameters, so it would look something like this:

 

IF [field1] ='text1' AND [ACCT] =12345 THEN 'ABC' ELSEIF
[field1] ='text2' AND [ACCT] =67890 THEN 'DEF'
else 'Not mapped' endif

 

Let me know if that works!

 

NJ


 

eliasg
7 - Meteor

@nicolejohnson & @barnesk

thank you both, it's working now!

Labels
Top Solution Authors