Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Pivot Table Totals?

I'm having trouble getting my totals to display in my pivot table. The expressions Total Mode options are grayed out and Partial Sums doesn't seem to add up correctly.

I need a sum of the Avg Duration and a Sum of the count of requests.

Any idea how to solve it? Do I need an AGGR statement?

Thanks!

1 Solution

Accepted Solutions
marcus_sommer

Quite often you need an aggr-function to get the right totals within a pivot, something like this:

sum(aggr(avg(Duration), Dimension1, Dimension2))

See also:

AGGR...

When should the Aggr() function NOT be used?

- Marcus

View solution in original post

3 Replies
marcus_sommer

Quite often you need an aggr-function to get the right totals within a pivot, something like this:

sum(aggr(avg(Duration), Dimension1, Dimension2))

See also:

AGGR...

When should the Aggr() function NOT be used?

- Marcus

cbaqir
Specialist II
Specialist II
Author

That works for the total but it seems I can't have the Programs across the top with the totals.

marcus_sommer

I don't know what you mean with "Programs across the top with the totals" (with the PE I couldn't look in your app) - but a pivot is very flexible. You could drag the dimensions and expressions vertically and horizontally and if the calculations are bit more complex as normal aggr() you could wrap them in some additionally conditions like:

if(condition, aggr1, aggr2)

pick(condition, aggr1, aggr2, aggr3)

if(dimensionality() = X and/or secondarydimensionality() = Y, aggr1, aggr2)

- Marcus