Hello,
I have a date field, and I would like to create a new column that aligns with the date to reflect the quarter it's in.
So with the date provided above, the new field would have Q3.
I thought I could do this with the DATETIME tool, however, I cannot.
Please and Thank you!!! as always :)
Adam
Solved! Go to Solution.
Hey @Adam_B, just one of those we have to calculate ourselves (at least for now!):
I did actually create this as a possible output in a macro I created a while ago, though it only prints out the number: https://community.alteryx.com/t5/Community-Gallery/Enhanced-DateTimeTrim/ta-p/972535
@DataNath So I have to enter in the Quarter manually? Can I establish a range?
For Example,
If date IN 1/1/2020-3/31/2020 then Q1 or 4/1/2020-6/30/2020 then Q2?
Just not sure how to format that formula.
Oh no @Adam_B, when I said calculate ourselves I just meant we need to set up a formula. What I've posted above will still dynamically calculate any date's quarter. All the calc is doing is taking the month part of the date as an integer i.e. 5 for May right now, dividing it by 3 and then rounding that up to the next whole number which gives you the quarter. The final ToString() function around the outside just allows you to have the number as text so you can add the 'Q' to it for formatting.
@DataNath Thank you!!!