Discussion Board for collaboration related to QlikView App Development.
I want to calculate the cumulative of Process if the value in the Part field is same as the above value. If not then use the Process value for the next part to start the accumulation again. Below is an example.
I would like to do this in the script since I have many types of similar accumulations with a look back to the previous part.
Thanks for the help!
If you want to do it in the script you could use the Peek() function to check if the value of Part is the same as the value of the previously loaded record.
Something along the lines of:
if(Part = Peek(Part), Peek(Cumulative)+Process, Process) as Cumulative
I tried with some things. In the script you can try FieldValue, Previous and Peek function. But I was not able to get it with the script.
It can give only the sum of 2 rows. To get it for
In the chart you can just do a full accumulation and add Part as a dimension. It will automatically calculate thecummulative sum.
PFA the qvw file.
Process + If(ID = Previous(ID), Peek(Cumulative)) As Cumulative
ORDER BY Part, ID;