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

Alteryx Designer Desktop Discussions

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

IF Statements, Nested IF statements

apoorvsingh
6 - Meteoroid

Hey Guys, 

 

I think there is a problem with my IF statement in the example provided. What I want to do in the example provided is this:

 

The formula for CCD_Sent_In_Time should do this, If [Portal Status] is Registered or Registration Rejected Then the formula of IF [ReceivedDate] >= [ServiceDate] AND [ReceivedDate] <= [TW_Deadline] THEN 1  ELSE 0 ENDIF is put into place for CCD_Sent_In_Time but if the [Portal Status] is Info Provided then CCD_Sent_In_Time is 1 but if [Portal Staus] is Info Not Provided then CCD_Sent_In_Time is 0.

 

Thank you so much for your help in advance. 

8 REPLIES 8
echuong1
Alteryx Alumni (Retired)

You do not need the additional "IF" between each condition and "or". You can wrap parts of the statement in () to separate if needed. 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @apoorvsingh,

 

The issue is your "IF" statements, you don't need all of them. You can remove the ones i've highlighted in yellow below:

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

MichalM
Alteryx Alumni (Retired)

@apoorvsingh 

 

When you remove the IFs I highlighted you should be good

 

ifs.png

apoorvsingh
6 - Meteoroid

Hey Jonathan, 

 

Thanks for such an immediate response. Unfortunately I am still getting an error as shown in my attachment. â€ƒ

Still getting Malformed IF statement.PNG

apoorvsingh
6 - Meteoroid

@Jonathan-Sherman forgot to tag you to my response, my apologies. 

apoorvsingh
6 - Meteoroid

@Jonathan-Sherman Oh my God, it worked. I missed another IF. Thank you so much.

 

MichalM
Alteryx Alumni (Retired)

@apoorvsingh 

 

There's still an extra IF in your statement. You only need one at the beginning.

apoorvsingh
6 - Meteoroid

@MichalM 

 

Thank you so much, I really appreciate it and I see that now. This community is very nice and helpful, I genuinely appreciate it, 

Labels