Day of week as number
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Team,
Is there a way to get the number of a weekday out of a date?
Currently my data set is like below type: V_string.
I want to have a new column next to this Ac.GI date which say like:
"5" for the 12.11.2021 (Friday) etc...
Solved! Go to Solution.
- Labels:
- Datasets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
DateTimeFormat([Ac.GI date],'%w')
Goes from Sunday = 0 to Saturday = 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Christina_H
If I just add the formula I only have nulls. Can you please check attached file and let me know if I need to chance any format or so?
BR,
Pascal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @Pascal_R ,
Just one little thing to add here would be if you want to be sunday the seventh day insted of the first would be to add a replace to the formula too.
Replace(DateTimeFormat([Field1],'%w'),'0','7')
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @Pascal_R ,
You need first to transform the dates to actual dates that Alteryx can understand. As the stand on your file they are interpreted just as text. Try using this
Replace(DateTimeFormat(DateTimeParse([Ac.GI date],'%d.%m.%y'),'%w'),'0','7')
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is there a way to have it where Sunday is 1, Monday 2, etc.?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Use ToNumber(DateTimeFormat([Date], "%w"))+1
