Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SUM OF ROWS PIVOT TABLE

I have a pivot table and I am trying to get the sum of rows , I have 2 dimensions. I wanna show partial sum for both dimensions but show the sum of rows instead of expression total.

Below is my expression

If((sum({<Year={$(=MAx(Year))},NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=>}INDEMNITY_PAID_YTD-INDEMNITY_RECOVERY_YTD)

or

sum({<Year={$(=MAx(Year)-1)},NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=>}INDEMNITY_PAID_YTD-INDEMNITY_RECOVERY_YTD))='0',0,

((max({<Year={$(=Max(Year))},Month = {"<=$(=Max(Month))"} ,NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=>}MthNbr)/12)

*Sum({<Year={$(=Max(Year))},NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=,Month = {"<=$(=Max(Month))"}>} ind_budget)))

1 Reply
swuehl
MVP
MVP

In general, use advanced aggregation for sum-of-rows in a pivot table:

Sum(

     Aggr(

If((sum({<Year={$(=MAx(Year))},NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=>}INDEMNITY_PAID_YTD-INDEMNITY_RECOVERY_YTD)

or

sum({<Year={$(=MAx(Year)-1)},NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=>}INDEMNITY_PAID_YTD-INDEMNITY_RECOVERY_YTD))='0',0,

((max({<Year={$(=Max(Year))},Month = {"<=$(=Max(Month))"} ,NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=>}MthNbr)/12)

*Sum({<Year={$(=Max(Year))},NO_BOP_FLAG={'0'},ORGANIZATION_NAME= ,[Line of Business]=,Month = {"<=$(=Max(Month))"}>} ind_budget)))

, YourTableDimensionField1, YourTableDimensionField2

))