Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MULTIPLE YEARS AGGREGATION

In the above Pivot table I am trying to Aggregate 2006 thru 2012. So The Out put should look like below, Means I wann show Report Year (Max, Max-1 ,Max-2  and Max-3 shall show me the sum of All Previous Years.  My Current Expression is :

Count({<CLAIM_TYPE_CODE_COMPARE_YTD_FLAG={'1'},Year={$(=Max(Year)),$(=Max(Year)-1),$(=Max(Year)-2)},
Report_Year={"<=$(=max(Year)-3)>=$(=min(Year)-10)",$(=Max(Year)),$(=Max(Year)-1),$(=Max(Year)-2)}>} distinct [Claim No]) .

Pls Help

Required OUTPUT

6 Replies
MK_QSL
MVP
MVP

Provide 10 line sample data !

Not applicable
Author

Ok give me a sec pls

Not applicable
Author

In the Below Sample Data I wanna see sum(Suit) for Report Year 2015,2014,2013


and Report Year (2012,2011,2010,2009,2008) summed together to show for Report  Year 2012. So my output will be


Report Year      Suit


2015                  45

2014                  77

2013                  50


2012                   279

(Sum of Report Years 2012,2011,2010,2009,2008)


 

YearReport Year Suit NOI
201520152530
201520152025
201520143029
201520142535
201520142235
201520131015
201520131539
201520132569
201520122665
201520122637
201520122736
201520112233
201520111132
201520106317
201520093238
201520083638
201520083635
MK_QSL
MVP
MVP

Create a Pivot Table

Dimension

1) Year

2) Calculated Dimension

=IF([Report Year] <= '2012','2012',[Report Year])

Expression

SUM(Suit)

Not applicable
Author

Thanx that worked partially, now I wanna make it Dynamic, instead of hard coding the  Year '2012'

Like when I select Year 2015, I wanna see

2015

2014

2013

2012 ( Sum of Prev Yrs)

When I select Year 2014, I wanna see

2014

2013

2012

2011 (Sum of Prev Years)

MK_QSL
MVP
MVP

Everything need to use as I suggested except calculated Dimension.

Change calculated dimension as below

=Aggr(IF([Report Year] > Max(TOTAL [Report Year])-3, [Report Year],Max(TOTAL [Report Year])-3),[Report Year])