Fetching the 3rd highest value from a 100 records.

I have a scenario like i have 100 records of employee and i want to fetch the 3rd highest salary of the employee.

How can we achieve this.

@TanyaS58 sort on salary property, and fetch the page. pxresults(3) data for the 3rd position.

@Anoop Krishna

how to configure this by activity or by report definition?

@TanyaS58 you need to use Report definition.

Use dpage-> RD

In RD, do sort order on salary. Then dpage.pxResults(3)

@Anoop Krishna could you please elaborate a bit,I am clear with the RD part but after fetching the salary by sorting how to loop in Dpage?

@TanyaS58 no no, no need to loop dpage. Dpage is just a page to hold the data. RD will fetch the data. If you run the RD itself you will see the data in sorted manner.

Then if you run the dpage (sourced with this RD), you will see the same results on this dpage as dpage.pxresults(n)

Now as you want 3rd highest, instead of n, 3. That is dpage.pxresults (3).

@TanyaS58 Please try in report definition for Top rank option. Please refer the screen below.

@TanyaS58 because by using activity and looping pageName.pxResults(3) its throwing an error.

Error with pxresults.docx (47.4 KB)

@Anoop Krishna Thanks for your explaination.

@Anoop Krishna just one small confirmation this dpage.pxResults (3) will be used in filter condn of RD right?

@TanyaS58 no no, that is the data we are getting from the data from the data page. If you want 2nd data, dpage. pxresults (2), like that.

In RD you will be just sorting based on salary.

You will get the results in dpage and you are going to use that data wherever you need. You are just applying sorting in RD. Nothing else need to be done. Data will be in your dpage and you can get the whichever data you need.