14 Replies Latest reply: Dec 19, 2016 10:35 AM by Sunny Talwar

# Cumulative sum in qliksense Bar Chart with two dimensions

Hello Guys,

Could you please help me how to calculate cumulative sum in qlik sense bar chart with 2 Dimensions.

This expression only works for 1 dimension:

rangesum( above( sum([Expression1]),0,rowno()))

I have data like below table where MonthName and Industry are dimensions in chart and Amount is Measure.

 MonthName Industry Amount Year Jan AA 100 2015 Feb BB 200 2015 Mar CC 300 2015 Apr DD 400 2015 May EE 500 2015 Jun FF 600 2015 Jul GG 700 2015 Aug HH 800 2015 Sep II 900 2015 Oct JJ 1000 2015 Nov KK 1100 2015 Dec LL 1200 2015

Thanks,

Ram Krishna

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

May be this:

RangeSum(Above(TOTAL Sum([Expression1]), 0, RowNo(TOTAL)))

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

Hi Sunny,

This only works with one dimension not with 2 dimension in chart.

Thanks,

Ram Krishna

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

I don't see a reason why it won't work.... Do you have a sample you can share your qvf where this is not working?

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

Hi Sunny,

I have attached a qvf file for you reference. You will see that above code works with only 1 dimension not with 2 dimension.

I am aware of above code and already worked with single dimension in many projects, Issue is when you add second dimensions in x-axis it will not work.

Thanks,

Ram Krishna

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

Are you looking for one of these output?

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

No, Value should be like same as Cumulative Sum with 1 dimension(By Month).

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

You above value is showing the sum of the different industry by Month, not the cumulative sum.

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

I am not full understanding what you are after? Each month you have different industry?? I guess you are after the totals with 1 dimension?? But I am trying to understand how it would show up in two dimensions?

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

Actually i want cumulative sum By Industry and By Month in single graph(So taken 2 dimensions Industry and Month)

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

But in your sample, your industry never repeats. There is a new industry name in all different months. I guess can you update the sample and provide the numerical output for each month?

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

This is a sample data loaded through inline table.

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

Sure, but why is there no industry repeating for more than a month? Do you get what I am trying to say

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

Industry can repeat, I have attached updated file with repeated industry.

• ###### Re: Cumulative sum in qliksense Bar Chart with two dimensions

Here you go.... You will need to do some script manipulation to get this to work