I have a question is there an easy way or an add-on to Alteryx that will automatically convert the data format 2017-01-01 into 2017 Q1 ? How can I figure this out without a bunch of weird codes? Thanks.
Solved! Go to Solution.
Worked well. ThankQ
If you want to make it numerical and sortable, this is what I did:
tostring(DateTimeYear([Year_Month])) + tostring(
(if DateTimeMonth([Year_Month]) in (1,2,3) then 1
elseif DateTimeMonth([Year_Month]) in (4,5,6) then 2
elseif DateTimeMonth([Year_Month]) in (7,8,9) then 3
elseif DateTimeMonth([Year_Month]) in (10,11,12) then 4
else Null() endif))
hello, to make this formula work, what should be the data format of the output? thanks!
Thank you! This worked like a champ!
My date is a vw-string type in the format year & month:
I need to convert to quarters & years:
etc.
Is there a formula I can use ?
Take a look at the below solution. I used this and modified it to meet your needs. Not sure if that helps because Your output would still not read as a date if you were doing time series analysis.
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Date-format-to-Quarter/td-p/57291
Thanks David - works perfectly !
Thanks @KaneG
Nifty formula!
I made this to get the end of the previous quarter.
Feels a little long winded, but works nicely.
Pro-tips appreciated 🙂
DateTimeTrim(
toDate(
DateTimeFormat([date],'%Y') + "-" +
padleft(tostring(Ceil(ToNumber(DateTimeFormat(DateTimeAdd([date],-3,"month"),'%m'))/3)*3,0),2,"0") + "-01")
, "lastofmonth")
Wrong post, sorry!!
Hello Sir, Source that you referring is deleted, can you share the "tools created by James Dunkerley" please