aspnet-7277-components-pivot-grid-data-shaping-sorting-display-top-n-values.md
In some instances, end-users do not wish to browse through an entire report, and only need to see the best or worst results. For this purpose, Pivot Grid provides the Top N Values feature that can be used to limit the number of field values to the specified number of topmost values according to the sort order.
Tip
Demo: Top Values
To enable this feature, use the PivotGridFieldBase.TopValueCount property. This property allows you to restrict the number of field values that are displayed along the column or row axis. If the PivotGridFieldBase.TopValueCount property is set to 0 , ASPxPivotGrid displays all field values.
By default, the PivotGridFieldBase.TopValueCount property determines the absolute number of field values to display. You can also use this property to specify the required number as a percentage ratio. Note that in this instance, you should set the PivotGridFieldBase.TopValueType property to PivotTopValueType.Percent.
The meaning of this percentage ratio depends on the current data binding mode as follows.
If the Top N Values feature is enabled, the pivot grid displays the first field values according to the current sort order. The other values are hidden and are not used to calculate totals. To display this information, set the field’s PivotGridFieldBase.TopValueShowOthers property to true. The remaining (hidden) values are combined into a single item (‘Others’). The ‘Others’ item is displayed below field values.
Note
In an OLAP mode, totals are calculated against all values even if the Top N Values feature is enabled.