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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
varunreddy
Creator III
Creator III

Accumulation based on previous value

Hi Guys,

I have this as an input:

 

Date

 

Pace

 

1/1/2015

 

1

 

1/1/2015

 

2

 

1/1/2015

 

3

 

1/1/2015

 

5

 

1/2/2015

 

6

 

1/3/2015

 

1

 

1/3/2015

 

2

 

1/3/2015

 

3

I want this as an output:

1/1/2015 - (1+2+3+5)/4 = 11/4 = 2.75

1/2/2015 - (1+2+3+5+6)/5 = 16/5 = 3.2

1/3/2015 - (1+2+3+5+6+1+2+3)/8 = 22/8 = 2.75

Can any one please help me?

Thanks in advance

Regards,

Varun Reddy

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: rangesum(above(sum(Pace),0,rowno()))/rangesum(above(count(Pace),0,rowno()))


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: rangesum(above(sum(Pace),0,rowno()))/rangesum(above(count(Pace),0,rowno()))


talk is cheap, supply exceeds demand
varunreddy
Creator III
Creator III
Author

Hi Gysbert,

This is working.

Thanks a lot for your quick response.

Can you tell me how rowno() is used for in this expression?

Regards,

Varun

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The RowNo() function is used to calculate the current row number of the table in the evaluation of the expression. That value is used in the Above() function to specifify the interval over which the expression inside the above function is applied.


talk is cheap, supply exceeds demand
varunreddy
Creator III
Creator III
Author

Thank You Gysbert

Cheers!