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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Subtotals for multiple expressions in pivot table?

pivttable.pngHi,

I have a pivot table for annual sales forecasts, showing the 12 months of the year as the horizontal dimension, and the expression "sum(ForecastAmt)". I've been asked to add a second expression, which is "Sum(ForecastAmt)*ForecastProbability".

My pivot table shows correct sums for "Annual Total" at the far right, and the Monthly Totals for the first expression are correct. However, the monthly totals for the new expression don't show up, nor do the annual totals add up for the second expression to a grand total. Any thoughts?

1 Solution

Accepted Solutions
Not applicable
Author

Can you try sum(ForecastAmt*ForecastProbability). 

The whole expression needs to be aggregated. In this case its sum().

Thanks

AJ

View solution in original post

4 Replies
Not applicable
Author

Can you try sum(ForecastAmt*ForecastProbability). 

The whole expression needs to be aggregated. In this case its sum().

Thanks

AJ

Not applicable
Author

Thanks, AJ! Worked perfectly.

Anonymous
Not applicable
Author

you might have to use agggregate function for the dimension where you want the total . For example if you want the total to be at month. then your expression would be sum(aggr(sum(ForecastAmt*ForecastProbability),Month)). If this does solve pleae post the QVW doc with some sample data.

veidlburkhard
Creator III
Creator III

Hi Kevin: try this expression for your 'ProbAmt';

Sum(Aggr(Sum(Amount) * Prob, [Opp Name])).

Look at the simple example below:

PivotTest.jpg

Hope this helps,

Regards

Burkhard