Is it possible to lookup the 2nd to last matc...

(Kyle Bowling) #1

Is it possible to lookup the 2nd to last match?

I use maxrow to lookup the last match, but would like to also retrieve the match before that.

(Suvrutt Gurjar) #2

Hi @Kyle_Bowling, You may wish to try something like below

INDEX((top(orderby(filter(TableName, true), [By Column Name], true), 2)),2)

(Suvrutt Gurjar) #3

The expression can be further simplified as

INDEX(ORDERBY(FILTER(TableName, true), [By Column Name], true),2)

Just wanted to mention that this input of making the expression more compact is from senior colleague @Aleksi_Alkio

(Kyle Bowling) #4

Thanks!