Ranking functionality is not as straight forward when it comes to Crystal Reports. In webi we can directly use the Ranking option present in the toolbar to perform ranking. I had a requirement in my project to select top 10 records based on some measure value. There might be many solutions available, but I came up with the following one:
I have used the e-Fashion universe for demonstration purpose.
Steps:
1) Create a simple crystal report using the fields as shown below:
2) Preview the report. The report will look like this:
3) Go to the Record sort expert and sort the Sales Revenue in descending order:
4) Create a new running total field “Test” with the following parameters:
· Field to summarize: Sales Revenue
· Type of Summary: Nth Largest
· N Is: 10 (as per requirement)
Click Ok.
5) Drag that New running total field “Test” in the report and see the results. The report will look like:
6) Go to the Section Expert in the Report tab.
7) Select the details tab and edit the formula Suppress(No Drill-Down):
😎 Write the formula:
{Agg_yr_qt_mt_mn_wk_rg_cy_sn_sr_qt_ma.Sales_revenue} < {#Test}
Click Save & Close.
9) The report will look like:
10) Remove the running total field from the report as we don’t require it. Add the Record Number field from the Special fields & name it as Rank.
Thus we have a report showing only top 10 records revenue wise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
50 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |