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: 
Not applicable

Accumulation sum in pivot table

Hello, I have a following data

LOAD * INLINE [

Year, Country, Sales

2010, USA, 6013

2011, USA, 5295

2012, USA, 5551

2013, USA, 6932

2010, UK, 4512

2011, UK, 3976

2012, UK, 4691

2013, UK, 5276

2010, Japan, 2765

2011, Japan, 2567

2012, Japan, 3111

2013, Japan, 3234

2010, Germany, 4374

2011, Germany, 5673

2012, Germany, 4322

2013, Germany, 7654

2010, France, 4965

2011, France, 5097

2012, France, 5419

2013, France, 5732

2010, Australia, 3966

2011, Australia, 4087

2012, Australia, 2376

2013, Australia, 3784

];

If I create a new pivot with Year and Country dimensions

I can easily calculate:

Sales by Country  =Sum(Sales)

Total in country dimension =RangeSum(Above(Sum(Sales),0,RowNo()))

And overall Total =RangeSum(Above(TOTAL Sum(Sales), 0, RowNo(TOTAL)))

How can I calculate an overall total by countries? I want full accumulation sum only by countries through the years. This can be easily achieved by swapping dimensions, but this method does not suit me.

10 Replies
Not applicable
Author

Thank you, it makes the expression much easier.