Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mgranillo
Specialist
Specialist

Below function vs above function

I have an  issue with the above and below function. 

Lets say i have the following table in a chart:

Date            Value    RowNo()

1/1/2017     4               1

1/2/2017     4               2

1/3/2017     7               3

1/4/2017     2               4

I can add another expression RangeMax(above(sum(value),0,rowno())) and this will return

Date            Value     RowNo()     RangeMax(above(sum(value),0,rowno()))

1/1/2017     4                  1                    4

1/2/2017     4                  2                    4   

1/3/2017     7                  3                    7

1/4/2017     2                  4                    7

Now I'd like to sort my table by descending date.  What do I need to change in RangeMax(above(sum(value),0,rowno())) to keep the same results? 


Is this something simple that I'm missing?  I tried the below function but it doesn't work with how RowNo() works

Date            Value     RowNo()             ?

1/4/2017     2                  1                    7

1/3/2017     7                  2                    7

1/2/2017     4                  3                    4

1/1/2017     4                  4                    4

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi Michael,

maybe this

RangeMax(Bottom(Sum(Value),1,NoOfRows()-RowNo()+1))

Regards,

Antonio

View solution in original post

4 Replies
mgranillo
Specialist
Specialist
Author

Attaching sample Qlik Sense app

antoniotiman
Master III
Master III

Hi Michael,

maybe this

RangeMax(Bottom(Sum(Value),1,NoOfRows()-RowNo()+1))

Regards,

Antonio

effinty2112
Master
Master

Hi Michael,

Try:

RangeMax(Below(sum(Value),0,NoOfRows()- RowNo()+1))

Cheers

Andrew

mgranillo
Specialist
Specialist
Author

Both seem to work. Thanks for the help.  Antonio's response came in first so marking his as correct