This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!
Hi all,
I have column with "date" date type field and the values there are for instance "DEC-20", "NOV-20".
I would like to change this column to the number of the month, e.g. "12", "11", ... .
Anyone has a simple solution to do so?
Alternatively, it it's easier to convert to the month number from the string, please say so. In my workflow I currently converted the string already to a date field. So both options are fine for me.
Really appreciate your help and many thanks in advance.
Have a nice day,
Christoph
Solved! Go to Solution.
Hi @ChristophVW ,
You can try using the DatetimeMonth() function which will return you the numeric value for a month in a date field.
So if your date field is called [Order Date] then the formula you should use is:
Tostring(Datetimemonth([Order Date]))
Hope that helps,
Angelos
Thank you very much @AngelosPachis ! Works like a charm.
Only did a very minor tweak from 'Tostring' to 'Tonumber' in my case, but visually the same.
Thanks @ChristophVW ,
Try removing the 'Tonumber' part of the expression and see if it works without it. What the DateTimeMonth function returns to you is already a numeric value, so probably you can remove that part of the expression to make it less complicated.
Cheers,
Angelos