Hi Team,
Is there a formula which is creating a column with the current day of the week number?
Like if today is Tuesday (16.11.2021) it should give me 2 (staying for second day of a week).
Best regards,
Pascal
Hi @Pascal_R ,
I don't think there's a native function within Alteryx that does that, but you can come up with your own by using a lookup table.
Hello @Pascal_R ,
You can easily do it with this formula:
Replace(DateTimeFormat(DateTimeParse([Field1],'%d.%m.%y'),'%w'),'0','7')
What I am doing here is first take your date and transform it into a date time format, afterwards I select the day of the week with the %w parameter.
For last what I do is replace the sunday '0' with '7' but thats just in my case. For me the week starts on mondays 🙂
Regards
@afv2688 @AngelosPachis
Thank you already for you help!
Is there a way to just put it into the formula tool?
Like to take DateTimeToday() for each time when I run it?
BR,
Hello,
Please see below :
DateTimeFormat([DateField],"%w")
You can fin more details here : https://help.alteryx.com/20213/designer/datetime-functions
Hope this helps,
Regards.
Hi @Pascal_R
Use the following expression in a Formula tool:
The DateTimeStart() is better than DateTimeToday() if in the event that you want to capture the day in which the workflow started and not when it ended, if running over midnight.
DateTimeFormat(DateTimeStart(),"%w")
Learned something new - always something new to learn in Alteryx-land. Thank you. I like this method for its simplicity 🙂
Thanks ! This is exactly what I was looking for. Love the Alteryx community.