Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Accumulation - include first row in totals

Hi,

I'm having an issue with my accumulation function. I need it to include the value on the first row as well. Below is the output I am currently experiencing, however what I was expecting to see is in the "Running Total" column - 75.73% on the first row and the subsequent values adding on top of the initial value. Any assistance would be greatly appreciated.

Here is how the columns are being calculated:

Relative Total: sum(count) WITH relative option selected

Total Count: sum(count) WITHOUT relative option selected

Running Total: Above(TOTAL Column(1)) + If(Above(TOTAL Column(3)) > 0, Above(TOTAL Column(3)), 0)

7 Replies

Re: Accumulation - include first row in totals

Does this help:

if(rowno()=1,sum([Relative Total]),RangeSum (above(sum([Relative Total]),0,RowNo())))

This 

is different data set but as you see is working

Not applicable

Re: Accumulation - include first row in totals

Hi Robert,

Thank you for your reply but using your solution fills all of the rows with 0%test.png

Re: Accumulation - include first row in totals

I'm at home using PE so I can not ask for qvw file unless you can wait till tomorrow when I at work.

But if you can post sample of your data I can look at this again

Not applicable

Re: Accumulation - include first row in totals

Here is a .csv of the raw data. In the table i'm rolling the data up to Month-Year

ramoncova06
Valued Contributor III

Re: Accumulation - include first row in totals

This works for me

if(RowNo(total) = 1,column(1)/sum(total cnt),

rangesum(column(1)/sum(total cnt),Above(total [Running Total]))

)

Not applicable

Re: Accumulation - include first row in totals

Thank you for the reply Ramon. Unfortunately using your solution is not accumulating the relative percentage.Is there any other options i need enabled?test.png

anbu1984
Honored Contributor III

Re: Accumulation - include first row in totals

Running Total: Alt(Above( Column(3)),0)+Sum(cnt)

Running Total %: Column(3)/ Sum(TOTAL cnt)*100

Community Browser