Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for
Did you mean:
Creator

## How to calculate sum for quarterly basis

Hi Team,

Please find the dummy data as an attachment.

Requirement:

I have one dimension YearQuarter and two expression A1 and B1.

I want to calculate B1 expression in such a way that it should sum the data of A1 for 2016Q1, 2016Q2, 2016Q3, 2016Q4 and same for 2017 Quarter data. I want the B1 data as below:

YearQuarter2016Q12016Q22016Q32016Q42017Q12017Q22017Q32017Q4
A1579134182022
B13464

Please find the dummy data as an attachment. Can anybody give me the solution?

Thanks for your help!!!!!!!!!

1 Solution

Accepted Solutions
MVP

Try this:

If(Right(YearQuarter,1)='4', RangeSum(Before(Sum(Data), 0,4)))

3 Replies
Partner - Specialist

Hi,

Create a Year Field: Left(YearQuarter,4) as Year

Then in the expression use:

If(Right(YearQuarter,2)='Q4', Before(Sum(Aggr(Sum(Data), Year)), 3,1))

Saludos

MVP

Try this:

If(Right(YearQuarter,1)='4', RangeSum(Before(Sum(Data), 0,4)))

Creator
Author

Thanks for your help..

It is working fine.

Community Browser