Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
fanninam
Creator
Creator

Quarter

I am trying to create a field for Quarter.  I only have a field for Year and a field for Month.  There is no date field.  Only a field for Year and a field for Month.  In this scenario, how can I create a field for Quarter?

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

If month is in number format (like 1, 2, 3 etc)... try this

'Q' & Ceil(Month/3) as Quarter
'Q' & Ceil(Month/3) & '-' & Year as QuarterYear

But if Month is text (like Jan, Feb, Mar etc)... try this

'Q' & Ceil(Month(Date#(Month, 'MMM'))/3) as Quarter
'Q' & Ceil(Month(Date#(Month, 'MMM'))/3) & '-' & Year as QuarterYear

View solution in original post

2 Replies
sunny_talwar

If month is in number format (like 1, 2, 3 etc)... try this

'Q' & Ceil(Month/3) as Quarter
'Q' & Ceil(Month/3) & '-' & Year as QuarterYear

But if Month is text (like Jan, Feb, Mar etc)... try this

'Q' & Ceil(Month(Date#(Month, 'MMM'))/3) as Quarter
'Q' & Ceil(Month(Date#(Month, 'MMM'))/3) & '-' & Year as QuarterYear
fanninam
Creator
Creator
Author

Thank you Sunny!