Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
Showing results for 
Search instead for 
Did you mean: 

Line Graph with two dimensions and accumulative values


I´m triying to make a line graph with dimensios MonthYEAR and a line with the accumulative value of the month and the year. For example we could have this kind of input data:

Year,MonthYEAR,Amount, Perecentage

2009, January2009, 10 , 5

2009, February2009, 20,4

2009, February2009, 30,6

2009, Marcha2009, 56,2

2009, April2009, 15,

2010, January2010, 20, 6

and we would like to have an line graph comparing this two expressions:

MonthYEAR, sum(Amount*Percentage)/sum(Amount) accumulated by month of the year

January2009, 5 --> (10x5/10)

February2009, 5,16 --> (10x5+20x4+30x6)/(10+20+30)

Marcha2009, 4--> (10x5+20x4+30x6+56x2)/(10+20+30+56)

April2009, 3,33 --> (10x5+20x4+30x6+56x2+15x1)/(10+20+30+56+15)

January2010, 6 --> (20x6)/20

Notice that in January 2010 the accumulative is restarted. With the help of this fastantic forum I made it in a simple table but if I tried to translate it to a graph, in January QV still calculates the accuumulative with 2009 values and do not restart the expression.

Thanks in advance,

2 Replies
Not applicable

attached an example of how I would do it.
Calculate the 2 fields in the chart:

Field1: Amount * Percentage
Field2: accumulated sum of Amount

Don't show these fields in the chart and then have a third field/value where you do Field1/Field2.

I don't know how to reset the accumulation though.

Hope that helps a little.



Here are both solutions from the previous thread, now expanded to include your new requirement.