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: 
agni_gold
Specialist III
Specialist III

How to make Quarter field from Year and Month Dimension

How to make Quarter field from Year and Month Dimension

Please help

I have data like Apr2014, so may periods are preset like that

3 Replies
sunny_talwar

May be like this:

'Q' & Ceil(Month(Date#(YearMonth, 'MMMYYYY'))/3) as Quarter

swuehl
MVP
MVP

You need to start with a QV date field, so if you have Year and Month dimensions, you may need to parse the field values to create a date:

Makedate( Year, Month) //if Month and Year have numeric representation

Date#( Month&Year, 'MMMYYYY')  // if Month is a text only

Then use e.g. QuarterStart(DateField) to create a quarter dimension

rubenmarin

Hi Agnivesh,

From a month field you can create:

Ceil(Num(Month)/3) & 'Q' // you can add the year if you want.

From a 'Apr2014' date you can do:

Ceil(Num(Month(Date(Date#(DateField, 'MMMYYYY')))) /3) & 'Q' // If you want the year you can add "& Right(DateField, 4)"