Home > Articles > Data > BusinessObjects/Crystal Reports

  • Print
  • + Share This
  • 💬 Discuss
This chapter is from the book

This chapter is from the book

Using Parameters with Top/Bottom N Group Selections

New to version XI, you can now use a parameter to dynamically affect the value of a top or bottom group selection (for instance, top five countries for sales or top five selling products). You have already completed the task of implementing a parameter field called Top N Value within this chapter's sample report. Now you learn how this parameter field can also be used to filter the data retrieved by a report.

In the following steps, use the same World Sales Report to implement the Top N Values parameter field (created earlier in the chapter) to filter the report results by including the parameter field within a formula definition that specifies the Top (or Bottom) N value (using the Group Sort Expert dialog). In this case, you enable the business user of the report to select a value that will filter the report results to include only the specified number of top-selling countries' data. The following steps demonstrate how this single report can be used to display multiple Top/Bottom N views:

  1. Open the Group Sort Expert dialog displayed in Figure 5.12 by clicking the Report menu and choosing Group Sort Expert. Ensure you are positioned on the Country Group tab.
    Figure 5.12

    Figure 5.12 The Group Sort Expert enables specification of a dynamic Top/Bottom N value through the x+2 button.

  2. Ensure the Top N sorting order is selected in the first drop-down box and it is based on the Sum of Last Years Sales. Click on the x+2 button beside the Top N value box. This will bring up the Formula Workshop where you add the {?Top N Value} parameter field to the formula. You have now connected the selected number of top-selling countries that will be displayed in the report to the N value specified by the end user through the Top N Value parameter.
  3. Change the value of the various parameters and refresh the report a few times to see the impact of an end user changing just these three parameters.
  • + Share This
  • 🔖 Save To Your Account

Discussions

comments powered by Disqus