Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Quick If/Then problem

Riot
8 - Asteroid

I am trying to create a formula that tells me if the day of the week is Fri, Sat Sun not. Here is what I am using: 

 

IF Contains([DayOfWeek],"Friday","Saturday","Sunday")
THEN 1
ELSE 0
ENDIF

 

But that isnt right. Anybody know how to fix it?

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus
IIF([dayofweek] IN ("Friday", "Saturday", "Sunday"),1,0)
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
chris_love
12 - Quasar
Try something like this:

If contains([DayoftheWeek],"Friday") or contains([DayoftheWeek],"Saturday")
or contains([DayoftheWeek],"Subday")
Then 1
Else 0
Endif
MarqueeCrew
20 - Arcturus
20 - Arcturus

Welcome back Chris!

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
GarthM
Alteryx Alumni (Retired)

there's also this:

 

Switch(DateTimeFormat([dayofweek], '%A'), 0,
'Friday', 1,
'Saturday', 1,
'Sunday', 1
)

Labels