Knowledge Drop

Get the second max value with table calc

  • 7 July 2021
  • 0 replies
  • 44 views

Userlevel 3
Badge

Last tested: Jun 1, 2018

 

We can use the approach below to exclude the max value using and if() then applying a max on the remaining values

max(if(${orders.count}!=max(${orders.count}), ${orders.count}, null))

 

(and so on for 3rd max...)

 

For pivoted results:

max(pivot_row(if(pivot_index(${orders.count},pivot_column())!=max(pivot_row(${orders.count})), ${orders.count}, null)))

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply