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: 
kevbrown
Creator II
Creator II

Quarter Start

I have the following dimension in a line garph - Ceil(Month(ukmpsmr_risk.INCEPTION_DATE)/3) - my problem is for some of my customers they're year starts in March so i need the quarters to start from March, the current expression will always start at January, any ideas?

Kev

1 Solution

Accepted Solutions
aveeeeeee7en
Specialist III
Specialist III

Use this:

Ceil(Num(Month(Addmonths(ukmpsmr_risk.INCEPTION_DATE,-2)))/3)   // It will start your month from March

You can also create Quarters in the Script:

'Q'&um(Month(Addmonths(ukmpsmr_risk.INCEPTION_DATE,-2)))/3)   // It will start your month from March

Regards

Av7eN

View solution in original post

6 Replies
sivarajs
Specialist II
Specialist II

Add 3 months to the date using addmonths will help

Ceil(Month(Addmonths(ukmpsmr_risk.INCEPTION_DATE,3))/3)

kevbrown
Creator II
Creator II
Author

If i then select April it still says quarter 2, April should be part of quarter 1

Anonymous
Not applicable

Then try with

Ceil(Month(Addmonths(ukmpsmr_risk.INCEPTION_DATE,-3))/3)


April, May and June will appear in Quarter 1

July, August and September will appear in Quarter 2,

and so on..


Take into account last quarter will appear now in Quarter 1.  I am not sure hat is what you need...


Marc.

kevbrown
Creator II
Creator II
Author

Tried that, the quarters work for the labels but the sum expression doesn't.  If i just select March, April and May the total is correct, if I select April to September Quarter 1 is inflated

aveeeeeee7en
Specialist III
Specialist III

Use this:

Ceil(Num(Month(Addmonths(ukmpsmr_risk.INCEPTION_DATE,-2)))/3)   // It will start your month from March

You can also create Quarters in the Script:

'Q'&um(Month(Addmonths(ukmpsmr_risk.INCEPTION_DATE,-2)))/3)   // It will start your month from March

Regards

Av7eN

kevbrown
Creator II
Creator II
Author

worked a treat, thanks