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: 
rathnam_qv
Creator
Creator

Query for Calculate Quarter values in DB2

Hi all,

Now i am doing Validation..

i have month id's like (201201,201202,201203........201212)Jan  to  Dec..

i am trying to calculate Quarter values..but it's not giving Cumulative values..it's giving value for each month...

can any one help me to get that values for each quarter...

Thanks!!!

Smiley

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Create a quarter in script.

     Something like this.

     Ceil(num(Month(Makedate(right(Field,4),Left(Field,02))))/3) as Quarter.

     Here Field is the column name which has text inthe form of YYYYMM.

     One you get the correct Quarters then use the Quarter field in your chart/Groups to get Values according to Quarter.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
rathnam_qv
Creator
Creator
Author

Hi Kaushik,

Thanks for ur replay

But i need to calculate that in Sql Server

so, i need  SQL Query