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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

How to show Sum of Rows in a Pivot Table?

Hi, I have a chart which can toggle between Straight Table and Pivot Table. Normally the sum of rows shows correctly in the Straight Table. But in Pivot Table I want the same result. How to achieve this? Please help on this matter.

Normally how to enable a Sum of Rows in a Pivot Table?

Attached is the screenshot of the issue what I am getting:

Pivot.png

For the KPI Order Qty and Variance, the summation shows incorrect, I need sum of rows. Plese check below the expression for Order Qty.

Below is the Expression used, please check if something needs to be changed in expression:

If (GOD53_SHIP_DATE_TIME_COUNT > 1    and

    GOD53_DELV_SCDL_REV_QTY = 0

    ,null(),

If ( (

                     ( left (Var_Variance, 1) = '1' )       or

                     ( left (Var_Variance, 1) = '2' and

                       Sum(GOD53_DELV_SCDL_REV_QTY) <> Sum(GIV14_ASN_PART_QTY) and

                       Sum(total <GOD53_SUPP_CD, GOD53_SUPP_LOC, GOD53_PART_NO, GOD53_PART_CLR_CD, GOD53_ORD_NO, GOD53_SHIP_TO_CD> GOD53_DELV_SCDL_REV_QTY) <> Sum(total <GOD53_SUPP_CD, GOD53_SUPP_LOC, GOD53_PART_NO, GOD53_PART_CLR_CD, GOD53_ORD_NO, GOD53_SHIP_TO_CD> GIV14_ASN_PART_QTY)

                     ) or

                     ( left (Var_Variance, 1) = '3' and

                       Sum(GOD53_DELV_SCDL_REV_QTY)  = Sum(GIV14_ASN_PART_QTY) and

                       Sum(total <GOD53_SUPP_CD, GOD53_SUPP_LOC, GOD53_PART_NO, GOD53_PART_CLR_CD, GOD53_ORD_NO, GOD53_SHIP_TO_CD> GOD53_DELV_SCDL_REV_QTY) = Sum(total <GOD53_SUPP_CD, GOD53_SUPP_LOC, GOD53_PART_NO, GOD53_PART_CLR_CD, GOD53_ORD_NO, GOD53_SHIP_TO_CD> GIV14_ASN_PART_QTY)

                     ) or

                     ( left (Var_Variance, 1) = '4' and

                       Sum(GOD53_DELV_SCDL_REV_QTY)  < Sum(GIV14_ASN_PART_QTY) and

                       Sum(total <GOD53_SUPP_CD, GOD53_SUPP_LOC, GOD53_PART_NO, GOD53_PART_CLR_CD, GOD53_ORD_NO, GOD53_SHIP_TO_CD> GOD53_DELV_SCDL_REV_QTY) < Sum(total <GOD53_SUPP_CD, GOD53_SUPP_LOC, GOD53_PART_NO, GOD53_PART_CLR_CD, GOD53_ORD_NO, GOD53_SHIP_TO_CD> GIV14_ASN_PART_QTY)

                     )

           ) and

           (Sum(GOD53_DELV_SCDL_REV_QTY) > 0 or Sum(GIV14_ASN_PART_QTY) > 0 or Sum(REC_RECEIPT_QTY) > 0 )

          ,Sum(GOD53_DELV_SCDL_REV_QTY), null())

)

3 Replies
swuehl
MVP
MVP

Please check the HELP, chapter 'sum of rows in pivot tables using advanced aggregation'.

In principle, it looks like

=sum( aggr(

YOUREXPRESSION, YOURCHARTDIM1, YOURCHARTDIM2, YOUCHARTDIM3

))

dmohanty
Partner - Specialist
Partner - Specialist
Author

Thanks Swuehl,

Normally how to enable a Sum of Rows in Pivot table? As the Sum of Rows section is disabled in a Pivot chart.

swuehl
MVP
MVP

Sorry, you can't use the sum-of-rows option in a pivot table. You need to use a workaround as referenced in the above mentioned Help chapter.