Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

calculation help

Hi Experts,

Can any one please help me on below requirement.

In the below pivot table I have 3 Dimensions, Month Column and One measure is

Sum({<Agency={'USA'}>}Sales) here I am getting below output.

In the below screen shot right now getting each month related sales.

The requirement is I have to show current month + Previous month sales under each month instead of actual month sales as mentioned in the expected output row

Please help me on this.

Thanks in advance

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

I think this will calculate the right sum for you:

RangeSum( Before(TOTAL Sum(Sales),0,ColumnNo(TOTAL)))

2018-08-18 17_21_11-Film og TV.png

View solution in original post

6 Replies
Anonymous
Not applicable

The simplest way is using before() function

Sum({<Agency={'USA'}>}Sales) + before(Sum({<Agency={'USA'}>}Sales), 1)

mahitham
Creator II
Creator II
Author

Hi,

Thanks for your reply. Its not working

balabhaskarqlik

Month

=RangeSum(Above(TOTAL Sum(Sales), 0, RowNo(TOTAL)))

balabhaskarqlik

Change your dimensions...

=Aggr(RangeSum(Above(Sum(Sales), 0, RowNo())),Year, (Month, (NUMERIC)))

=aggr(rangesum(above(Sum(Sales),0,RowNo())),Month)

=Aggr(RangeSum(Above(Sum({<Month>}Sales), 0, RowNo())),Year, Month)

petter
Partner - Champion III
Partner - Champion III

I think this will calculate the right sum for you:

RangeSum( Before(TOTAL Sum(Sales),0,ColumnNo(TOTAL)))

2018-08-18 17_21_11-Film og TV.png

Anonymous
Not applicable

Oh,  sorry, did not notice the accumulation

RangeSum(before(Sum({<Agency={'USA'}>}Sales), 0, ColumnNo(TOTAL))should work