Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rangesum across the current row

Hi All,

I'm trying to get the sum of three values (1 row above+current row+1 row below) in a simple one dimensioned chart, as below. For row 7 in the example below, I'd want to sum the values 2+3+5 and I'd assumed the function rangesum(above(Yaxis,-1,3)) would do this.

Any idea what I'm doing wrong?

Thanks

DerekJ

rangesum.jpg

Message was edited by: derekj The help file shows... "rangesum (above(count(x),-1,3))" returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Above can only reference cells above or below, not both at once. You want to combine it with Below: rangesum(above(Yaxis),Yaxis,below(Yaxis))


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Gysbert_Wassenaar

Above can only reference cells above or below, not both at once. You want to combine it with Below: rangesum(above(Yaxis),Yaxis,below(Yaxis))


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

   
The help file shows...  "rangesum (above(count(x),-1,3))"   returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.
That's not what my QV HELP shows. Instead, it's telling me that a negative second argument to above() turns the function effectively into a below() function. That's what you see.
Go with Gysbert's recommendation instead.
edit:

QlikView 11.2, 11643

Not applicable
Author

Hi and thanks for the very quick reply.

It looks like you are correct from the results I had. However, the help file explicitly says :-

"rangesum (above(count(x),-1,3)) returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row."

Is this incorrect or am I reading it wrong?

DerekJ

Not applicable
Author

Hi and thanks for the very quick reply.

It looks like you are correct from the results I had. However, the help file explicitly says :-

"rangesum (above(count(x),-1,3))" returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.

Is this incorrect or am I reading it wrong?

DerekJ

Not applicable
Author

Hi and thanks for the very quick reply.

It looks like you are correct from the results I had. However, the help file explicitly says :-

"rangesum (above(count(x),-1,3))" returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.

Is this incorrect or am I reading it wrong?

DerekJ

Not applicable
Author

Hi and thanks for the very quick reply.

It looks like you are correct from the results I had. However, as I added above, the help file explicitly says :-

returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.

Is this incorrect or am I reading it wrong?

DerekJ

Not applicable
Author

Hi and thanks for the very quick reply.

It looks like you are correct from the results I had. However, the help file explicitly says...

"rangesum (above(count(x),-1,3))" returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.

Is this incorrect or am I reading it wrong?

DerekJ

Not applicable
Author

Hi and thanks for the very quick reply.

It looks like you are correct from the results I had. However, the help file explicitly says...

"rangesum (above(count(x),-1,3))" returns the sum of the three results of the count(x) function evaluated on the row below the current row, the current row and the row above the current row.

Is this incorrect or am I reading it wrong?

DerekJ