Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading customized data for quarter

Hi,

When we use the quarter function in Qlikview, we get months 1,2,3 as Q1 ... 4,5,6 as Q2 etc..

My requirement is to load months 4,5,6 as Q1 ... 7,8,9 as Q2 ... 10,11,12 as Q3 and 1,2,3 as Q4.. I want to do this in the load script..

Any help would be appreciated.

Thanks,

Sakshat

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Sorry, try this:
ceil((mod(Month+8,12)+1)/3)

View solution in original post

5 Replies
Not applicable
Author

Hi,

Just to add, I have tried using the If statement and LOAD INLINE...

though the If statement works, it is too long... Any shorter way to do this would be great!

Anonymous
Not applicable
Author

This will work, if Month is a numeric representation of month:
ceil((mod((Month+9),12))/3)
If you base it on date, it will be:
ceil((mod((month(Date)+9),12))/3)

Not applicable
Author

Hi Michael,

Thanks for your reply. This formula works for all months except month 3 Sad ..... there it evaluates to Q0

--Sakshat

Anonymous
Not applicable
Author

Sorry, try this:
ceil((mod(Month+8,12)+1)/3)

Not applicable
Author

Awesome ... this works Smile .. thanks a ton!