Date to quarter

Hi,

I have a date column, i want a VC for quarter means

Like if month of the date is

Feb, Mar, April = Q1
May, Jun,July = Q2
Aug, Sep, Oct =Q3
Nov, De, Jan = Q4

Hi @Anchor_Appadmin

Various possibilities

IFS(
   MONTH([TimeStamp])<=3,"Q1",
   MONTH([TimeStamp])<=6,"Q2",
   MONTH([TimeStamp])<=9,"Q3",
   true,"Q4"
)

Or (less efficient, according to article below):

SWITCH(MONTH([TimeStamp]),
   1,"Q1",
   2,"Q1",
   3,"Q1",
   4,"Q2",
   5,"Q2",
   6,"Q2",
   7,"Q3",
   8,"Q3",
   9,"Q3",
   "Q4"
)

See also:

EDIT :
@Steve in the article IFS, I think there are one extra comma in the end of the IFS and SWITCH example, Section " Weekday Name" ?

2 Likes

Fixed! Thanks for letting me know!

2 Likes