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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total columns using Pivot tables

Good afternoon,

I am having an issue showing column totals for a particular dimension.

The process breaks correctly based upon the dimension as a total line shows up but the totals are not being displayed.

My expression just looks for the values of the dimension that I am interested in and that works.

I added a sum expression for the column that I am looking to total and I am not sure that I am doing that correctly.

Please help.

Thank you,

Mitch

12 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I'd need to see more than that - all chart Dimensions and the full expression - AGGR by what dimensions ? aggregating what fields?

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Table has this info:

Process Status              Start                 End

A                                   100                    200

A                                   100                    200

A                                   100                        0

C                                   500                        0

C                                   250                    100

C                                   400                    200    

                  Results looking for are:

                     ProcessStatus              Start                 End

                     A                                   100                    200

                     A                                   100                    200

                     A                                   100                        0

Total             A                                   300                    400

                     C                                   500                        0

                     C                                   250                    100

                     C                                   100                    200

Total             C                                   850                    300

Grand Total                                      1150                    700

Dimensions are :

Process Status

Start

End

I have 2 expressions:

1) (aggr(sum(Start),ProcessStatus))

2)  (aggr(sum(End),ProcessStatus))

Presentation:

ProcessStatus (Show partial sums)

Start (Show partial sums)

End

This is what I get without the details:

Total             A                                   300                    400

Total             C                                   850                    300

Grand Total                                      1150                    700

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

OK, now the picture is clear 🙂

Your AGGR() functions aggregate data by Process Status, while the chart is trying to present the data at the detailed level - by Process status, Start, and End. Henric is calling it "grain mismatch", and I call it "unsafe used of AGGR in charts", or breaking the "Third Rule of AGGR()"... Simply put, the aggregated buckets coming out of AGGR() are not granular enough, compared to your chart Dimensions.

You have two choices here: either add Start and End to the dimensions of AGGR(), or avoid using AGGR() altogether, you don't really need it here. Simply use SUM() and it will do the job just fine:

sum(Start)

sum(End)

If you'd like to learn more about AGGR(), I encourage you to check out if Masters Summit for Qlik is a good fit for you. Or, check out my new book QlikView Your Business - I describe there all three rules of AGGR() and a lot more.

cheers,

Oleg Troyansky

Ask me about Qlik Sense Expert Class!