I have some data that looks like this: 2203
I want the 22 to be converted to 2022 and 03 to be converted to Feb (note that it should be the prior month)
So the newly generated columns should be 2022 under Year and Feb under Month.
Updated:
Since @Qiu has asked me: for 2201, the outputs should be 2021 under year and Dec under month.
Solved! Go to Solution.
Hi @45179902 ,
you could convert the number to a string, a the leading "century" and use DateTimeParse and DateTimeFormat to create the required date format.
I've splitted it to a 3 formulas. In the first formula, you could add a condition, if there are date from 19xx.
Let me know if it works for you.
Best,
Roland
@45179902
What will be result for 2201? 😁
Basically it will be combinations of DateTime Functions.
https://help.alteryx.com/20214/designer/datetime-functions
@Qiu That's a good question. In that case, should be 2021 and Dec.
Hi @45179902
Also here are some resources on the tools used
https://help.alteryx.com/20214/designer/datetime-functions
https://community.alteryx.com/t5/Engine-Works/DateTime-Functions-Cheat-Sheet/ba-p/844353
Hopefully, you learnt something new today which will help you in the future : )
Hope this helps : )
@45179902
Thank you for the confirmation.
Maybe we can do like this.