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
Solved! Go to Solution.
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
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.
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,
Pascal
Yes @Pascal_R ,
Like @afv2688 pointed out and I missed in my post above, you can put his expression in a formula tool and it will work. Still there's not something similar to the datetimetoday() function, but it will still work.
You can read more about the datetime functions within Alteryx in the following post:
Hello @Pascal_R ,
I don´t know if this is what you mean but you can add it of course to the datetimetoday formula:
Replace(DateTimeFormat(DateTimeToday(),'%w'),'0','7')
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.