pratikpathak Posted March 6 Share Posted March 6 Hi, I'm trying to find second maximum using custom expression, i know max([timeperiod]) gives maximum value from timeperiod, my question is how can i get Second maximum value using expression? best regards, Pratik Pathak Link to comment Share on other sites More sharing options...
Gaia Paolini Posted March 6 Share Posted March 6 have you tried using Rank or Denserank? Link to comment Share on other sites More sharing options...
pratikpathak Posted March 6 Author Share Posted March 6 1 hour ago, Gaia Paolini said: have you tried using Rank or Denserank? Not Yet, Would you please explain how I can achieve this task using Rank/Denserank Link to comment Share on other sites More sharing options...
Solution Gaia Paolini Posted March 6 Solution Share Posted March 6 You could define a column that ranks your [timeperiod] in descending order: DenseRank([timeperiod],'desc') then use it to find the maximum value of the expression DenseRank([timeperiod],'desc')=2 (which would be max when this statement is true), like this: ValueFormax(DenseRank([timeperiod],'desc')=2,[timeperiod]) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now