TopN grouping
If the number of values in the header group is large, it will generate an excessive number of report pages. TopN grouping allows you to display the first N values, and show the remaining values in a collapsed form:
How it works
TopN function uses four elements to display data:
TopN group is a source group containing a large number of values.
TopN total, which displays a total of TopN values.
Group "Others", which displays values that are not included in TopN.
The result of the group "Others".
If the source group has fewer values than specified in the TopN.Count
property, it is displayed as usual, without TopN grouping. Otherwise, the following happens:
- N values are left in the main group;
- the rest of the values are transferred to the "Others" group;
- data in the main group and in the "Others" group are aggregated;
- the obtained values are displayed as a total of TopN and as a total of the group "Others".
Setup
TopN is set up for the main group. To do this, double-click on the element or select "Edit ..." from the context menu.
There are two options for working with additional elements:
- the elements "TopN total", "Others", "Others total" are created automatically when building the matrix. Their visual design is copied from the main element. You can manage the visibility of the elements, as well as specify text for the total elements. There are no other options to customize the appearance;
- the above elements are added to the matrix template. This allows you to fully customize the appearance, as well as change the order of elements. You can add collapse buttons to interactively manage the visibility of individual elements.
Below is what the matrix template looks like when you add additional elements to it:
In this case, the main group is highlighted in red, and additional elements are marked with a lock icon. You can delete them in the main element editor window by unticking "Create additional items" checkbox.
TopN, BottomN, FirstN, LastN
The TopN engine uses the first N values in the original group. The meaning of the resulting values depends on how the original group was sorted:
- the group is sorted by the value of the header: the first N (ascending sort) or the last N values (descending sort) are displayed;
- the group is sorted by total value: the largest N (descending sort) or the N smallest values (ascending sort) are displayed.