Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
what is the rangesum (above(count(x),-1,3)) meaning?
Dear King,
Let assume this example
Id,Values
A,120
B,100
C,300
D,140
Rangesum( above (count (Values),-1,3 ) )
1. If you count Values with range sum with above function.
2. This expression Count(Values) count the values.
3. Above( Count(Values) ) this means it have to count value above but range is given -1, 3 means it checks value below upto 3 values (Rows).
4. Try to check another expression as range from 1 to 3
Rangesum( above (count (Values),1,3 ) )
You get 0,1,2,3
a. If you see the table for first row that is A there is no row above it.
b. Same for B row we check the rows upto 3 rows so we get only 1 row.
c. Same for C we get 2 row and for D we get 3 rows.
Note:- If you use this expression Rangesum( above (count (Values),-1,3 ) ) then just reverse your out put.
See this results:-
Id | rangesum (above(count(Values),-1,3)) | rangesum (above(count(Values),1,3) ) |
A | 3 | 0 |
B | 2 | 1 |
C | 1 | 2 |
D | 0 | 3 |
Regards,
Anand
Take a look here: Missing Manual - Above() and Below()
- Marcus
Actually this counts the row below the current row upto three rows rangesum (above(count(x),-1,3))
Ex:-
LOAD * Inline
[
Id,ColA
A,120
B,100
C,300
D,140
];
If you use this expression rangesum (above(count(x),-1,3))
You get result as
A 3
B 2
C 1
1. In c id Row you have only 0ne row that's why 1.
2. Same as for A and B.
Regards
Anand
I am sorry Anand Chouhan, I did not understand.
Dear King,
Let assume this example
Id,Values
A,120
B,100
C,300
D,140
Rangesum( above (count (Values),-1,3 ) )
1. If you count Values with range sum with above function.
2. This expression Count(Values) count the values.
3. Above( Count(Values) ) this means it have to count value above but range is given -1, 3 means it checks value below upto 3 values (Rows).
4. Try to check another expression as range from 1 to 3
Rangesum( above (count (Values),1,3 ) )
You get 0,1,2,3
a. If you see the table for first row that is A there is no row above it.
b. Same for B row we check the rows upto 3 rows so we get only 1 row.
c. Same for C we get 2 row and for D we get 3 rows.
Note:- If you use this expression Rangesum( above (count (Values),-1,3 ) ) then just reverse your out put.
See this results:-
Id | rangesum (above(count(Values),-1,3)) | rangesum (above(count(Values),1,3) ) |
A | 3 | 0 |
B | 2 | 1 |
C | 1 | 2 |
D | 0 | 3 |
Regards,
Anand