I'm having a hard time trying to produce the last 4 quarters from DateTimeNow(). I'll have to use the 4 quarters in the column name and also as a counter.
I found this in our community:
IF ceil(DateTimeMonth(DateTimeNow())/3)!=1 then
'Q'+tostring(ceil(DateTimeMonth(DateTimeNow())/3)-1)+tostring(DateTimeYear(DateTimeNow())-2000)
else 'Q4'+tostring(DateTimeYear(DateTimeNow())-2000-1) endif
But it doesn't work well past the previous quarter.
Any help would be appreciated.
Solved! Go to Solution.
What about parsing the month out from your date and using the following?
IF [2]>=1 AND [2]<=3
THEN "Q1"
ELSEIF [2]>=4 AND [2]<=6
THEN "Q2"
ELSEIF [2]>=7 AND [2]<=9
THEN "Q3"
ELSEIF [2]>=10 AND [2]<=12
THEN "Q4"
ELSE Null()
ENDIF
Hi @LudwigB I mocked a workflow that I think produces the output you describe. Let me know what you think?
Brandon, yes that works.
I should have been more specific..
The business need requires the quarters to be in either of these 2 formats. Its the year that's giving me problems. If I am using today and going back 4 quarters (not including our current qtr), we go into year 2018.
2019 Q1
or
Q1 19
You should be able to use the year that has been parsed out in conjunction with the quarter field that has been created. I have attached another workflow as an example. This final formula tool can be tweaked to say right([1],2) for example if you needed to pull the last two digits from year.
example of the formula for your second format