Forum Discussion
Month into quarter
- 4 years ago
One way to do this is to create a new Calculated Column using the SWITCH function:
Quarter = SWITCH( TRUE(), [YourDateColumn] = 01/03/2021, "Q1", [YourDateColumn] = 01/06/2021, "Q2", [YourDateColumn] = 01/09/2021, "Q3", "Q4" )This is similar to a nested IF function in Excel, but I find it much cleaner this way.
if you will have multiple years in your data, you will probably need a Year column as well:
Year = Year ( [YourDateColumn] )
And then lastly concatentate these two columns together. Something like Year-Quarter:
Year-Quarter = [Year] & "-" & [Quarter].
Hope this helps.
One way to do this is to create a new Calculated Column using the SWITCH function:
Quarter = SWITCH(
TRUE(),
[YourDateColumn] = 01/03/2021, "Q1",
[YourDateColumn] = 01/06/2021, "Q2",
[YourDateColumn] = 01/09/2021, "Q3",
"Q4" )This is similar to a nested IF function in Excel, but I find it much cleaner this way.
if you will have multiple years in your data, you will probably need a Year column as well:
Year = Year ( [YourDateColumn] )
And then lastly concatentate these two columns together. Something like Year-Quarter:
Year-Quarter = [Year] & "-" & [Quarter].
Hope this helps.