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: 
prabhu_rutali
Contributor
Contributor

Cumulative of sales

I want to calculate cumulative of sales monthwise ,means if i select month Apr then it will show me apr.But if i select May ,it will show me the sales of Apr+May .....& it must take the year  >2016

6 Replies
devarasu07
Master II
Master II

Hi,

you can try like below, select Year and Month from the list box.

Cumm. Sales

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


Capture.JPG

Thanks,

Deva

prabhu_rutali
Contributor
Contributor
Author

I have to exclude year 2016 & im showing this in straight table

devarasu07
Master II
Master II

Hi,

the same formula will work for straight table too, u can simply exclude specific year by using set analysis

=RangeSum(Above(TOTAL Sum( {$<Year-={2016}>}Sales), 0, RowNo(TOTAL)))

or use below fxn (it will show always the max year

=RangeSum(Above(TOTAL Sum( {$<Year={"$(=Max(Year))"}>}Sales), 0, RowNo(TOTAL)))

Thanks,Deva

devarasu07
Master II
Master II

Hi,

Let us know any issue, if not close this thread by marking helpful and correct. Thanks

prabhu_rutali
Contributor
Contributor
Author

THIS IS NOT WORKING.....It is showing me current years data....can you help me  by using YTD formula

devarasu07
Master II
Master II

Hi,

which method not working? as you said u wanted to exclude 2016 from your Cum. expression

YTD : // let say you have selected month as Mar'17 then this expression will return sum of sales from Jan'17 to till Mar17

sum({$<Year = {"$(=max(YEAR))"},Month = {"<=$(=max(Month))"}>} Sales )


ps: check this article if your using date filed instead of Month

YTQ, QTD, MTD and WTD

Set Analysis for certain Point in Time

Set Analysis for certain Point in Time