Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
L_Hop
Creator
Creator

cumulative sum in bar chart

Hello everyone,

I am trying to calculate cumulative sum in a bar chart in Qlik Sense which has two dimensions; month and year. My measure is sum of Sales.

What I want is, sales values should be cumulatively summed in bar chart for the selected months.


For example: March 2016  sales values should be sum of Jan 2016 and Feb 2016 on pivot table and rest of them also should be the same.

Right now I have below bar chart, it is only showing the related month year sales data.


bar chart.PNG

I have tried "=RangeSum(Above(Sum(Sales), 0, RowNo(total)))" but it has not worked. Result of the "=RangeSum(Above(Sum(Sales), 0, RowNo(total)))" is below picture.

rangesum_above_rowno().PNG

Please suggest me any solution if anyone of you gone through the same problem.

Thanks.

OY

30 Replies
I_Dia
Contributor
Contributor

Hello everyone,

I have a similar issue but even after using your solution my problem is still there.

My bar chart uses those 3 components :

- Dates as  Group : =Year(Date(Date#(MyField_Date,'DD-MMM-YY'),'YYYY-MM')) & ' - ' & num(Month(Date(Date#(Myfield_Date,'DD-MMM-YY'),'YYYY-MM')),'00')

- Status as Bars : = MyField_Status

- Cumulative Status as Lengh of bar : 

RangeSum(Above(

 Count (

if (

    Not Isnull (Date(Date#(MyField_Date,'DD-MMM-YY'),'MMM-YYYY'))

and 

    not 

        (

        isnull(MyField_Status) 

          or 

        len(trim(MyField_Status))= 0 

         ) 

,(Date(Date#(MyField_Date,'DD-MMM-YY'),'MMM-YYYY')),null()

)

    )

,0,RowNo()))

What I want is to have the cumulated number of dates associated with a status per Year. 
The counting is done on the month of the dates and the the cumulus goes back restart from 0 for each year.
 
The problem is that the cumulus only works on each individual Month-Year, meaning that it cumulates the number of status between themselves in one month at a time.
 
Does any one have an idea of what I can do or should do ?
 
Thank you in advance.