19
Views
7
Comments
Solved
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
Rank: #17
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

Rank: #1605

Hi @Daniël Kuhlmann 

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

Thanks

mvp_badge
MVP
Rank: #17
PlaygroundReactive.oml

Rank: #1605
Rank: #515

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.


Rank: #151

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

Rank: #287

Hi 

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

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

Kind Regards,