Hello,
How can I convert a certain number to a month. E.g. For 1, I want to return the equivalent which is January.
Thanks.
Solved! Go to Solution.
Hi @Gamaliel,
You could use the DateTimeFormat() function for this within a formula tool:
DateTimeFormat("2000-" + PadLeft(ToString([Month]),2,'0') + "-01",'%B')
Ensure your new field is a string data type (i've used V_WString in my example)
You'll find all the information about the various date transformation functions (DateTimeParse(), DateTimeFormat() being the main two but there's lots of others also available here: https://help.alteryx.com/current/designer/datetime-functions)
I've attached my workflow for you to download if needed, if you've got any questions on the formulas just let me know!
Kind regards,
Jonathan
Hi @Gamaliel
You can use a formula like this. Convert to date and then to month name.
DateTimeFormat(DateTimeParse(ToString([MonthNo]),"%m"),"%B")
Workflow:
Hope this helps 🙂
Sounds awesome. Thanks
Hi atcodedog05,
What does the "%m" denotes in the below formula. Your formula looks awesome.
"DateTimeFormat(DateTimeParse(ToString([MonthNo]),"%m"),"%B")"
Regards,
Vaithi
Hi @Vaithi
%m is the month i defining number to be treated as month and create date. This creates date on the min year and date would be something like 1900-02-01. %B will convert to month name.
Great. thanks @atcodedog05