Join the Inspire AMA with Joshua Burkhow, March 31-April 4. Ask, share, and connect with the Alteryx community!

Alteryx Designer Desktop Discussions

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

Boolean IIF Statement

tpostlewate
7 - Meteor

I was looking through some of the different content on the site, and I found the lesson on Boolean IIF statements. HOWEVER, the example looked incorrect when I ran it (and in the example): 


IIF([Day] != 'Sat' OR [Day] != 'Sun', 'Weekday', 'Weekend')

2016-08-01 Mon Weekday
2016-02-22 Mon Weekday
2016-03-12 Sat Weekday
2016-04-10 Sun Weekday
2016-05-06 Fri Weekday
2016-07-04 Mon Weekday
2016-06-05 Sun Weekday

I'm trying to understand where it is going wrong. If I remove the ! leaving just the = and switch the words weekday and weekend around, the statement works. Why is it not working when the ! is present? It seems like it is written correctly.
Thanks! This is driving me crazy.

2 REPLIES 2
clmc9601
13 - Pulsar
13 - Pulsar

Hi @tpostlewate, try using AND instead of OR.

Right now your expression says if the day isn't Saturday, then call it a weekday. This will apply to Mon, Tues, Weds, Thurs, Fri, and Sun. Then, the only row remaining is Sat, so Alteryx will apply the second argument (!="Sun"), evaluate it as true for Saturday, so it will call it a weekday. Your expression isn't considering !=Sat and !=Sun together, which is why you'll have to use AND.

tpostlewate
7 - Meteor

Thank you! That worked.

Labels
Top Solution Authors