Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

prabhu_rutali
New 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
Honored Contributor II

Re: Cumulative of sales

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
New Contributor

Re: Cumulative of sales

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

devarasu07
Honored Contributor II

Re: Cumulative of sales

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
Honored Contributor II

Re: Cumulative of sales

Hi,

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

prabhu_rutali
New Contributor

Re: Cumulative of sales

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

devarasu07
Honored Contributor II

Re: Cumulative of sales

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

Community Browser