Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Pivot table sums/totals

I have a pivot table where there are a number of groupings and I want totals for each grouping.

The problem is, that the totals are using the expression to calculate the totals.

As opposed to a "Straight table" you cannot specify in a pivot table how the totals are calculated.

In straight tables, you can specify "Sum" rather than "Expression" for the total calculation.

Is there anyone who can help me with this?

It is quite difficult to explain in few words, so I have included a sample with the problem.

Best regards

Steen Olesen

Tags (1)
1 Solution

Accepted Solutions
dennisnet
Valued Contributor III

Re: Pivot table sums/totals

Hi There,

Try the below expression in your Pivot table:

               SUM(AGGR(max(Sales) * (Max(StockLevel)), ProductSubGroup, ProductGroup))

I think that is what you looking for right?

Dennis.

3 Replies
Not applicable

Re: Pivot table sums/totals

Hi,

Maybe it's not the perfect solution,

I think you need to do the expression on the script end the do Sum on the layout.

See the attached qvw.

Hope it help.

Not applicable

Pivot table sums/totals

Thanks for your quick reply. However, the sample was a strip-down version of my real application trying to illustrate the problem. Unfortunately the calculations cannot be done at load time, since the columns in my real application are based on "set analysis" that depends on selections made by the user.

dennisnet
Valued Contributor III

Re: Pivot table sums/totals

Hi There,

Try the below expression in your Pivot table:

               SUM(AGGR(max(Sales) * (Max(StockLevel)), ProductSubGroup, ProductGroup))

I think that is what you looking for right?

Dennis.

Community Browser