how can i filter second highest salary from Employee table using Aggregate only
Application Type
Traditional Web
Service Studio Version
11.10.9 (Build 38645)

how can i filter second highest salary from Employee table using Aggregate only. I don't want to use SQL 

Is it possible this filter using Aggregate.

Screenshot252.png

mvp_badge
MVP
Solution

Hi Subhashish,

Use an aggregate sorted on salary descending, and max records set to 2

Then get the last row from the result list by using the Aggregate.List.Length property - 1

Regards,

Daniel

Hi @Daniël Kuhlmann 

I am unable to do it. please Can do it with oml file

Thanks

Hi Subhashish Rout,

You could achieve this by sorting the Aggregate by salary and set the aggregate StartIndex attribute to 1. Thus, the first record available will be the second highest salary.

Hope it helps.

Best regards.


mvp_badge
MVP

Hi Subhashish Rout

I created an example app so you can have one more way to get the result you want:


.OML in attachment.

Hope it's help.

Regards.


ExampleGetSalary.oml

Champion

Hi 

Daniël's answer is the best way to achieve this.

What do you mean "I am unable to do it."?

Kind Regards,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.