Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
DaanBrand
Contributor
Contributor

Rangemax second greatest value

Hi,

I have a question about the rangemax function.

I want to create a rolling average over 10 week excluding the two min- and max values over this 10 week.

I made it to find the max value with the rangemax function:

Rangeavg(above(sum(aggr(sum(Omzet.Gewicht),ArtID,WeekYear)),1,10))

But is it possible to get the second greatest value? With something like the Max(value, 2) function?

Knipsel.PNG

Thanks in advance.


Daan

1 Reply
antoniotiman
Master III
Master III

Hi Daan,

try this

Max(Aggr(If(Rank(Sum(Omzet.Gewicht)) > 1 and Rank(-Sum(Omzet.Gewicht)) > 1,Sum(Omzet.Gewicht)),ArtID,WeekYear))

Regards,

Antonio