PivotGridFieldBase.TopValueCount Property
Gets or sets the absolute or relative number of field values that should be displayed for the current column field or row field.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.PivotGrid.v24.2.Core.dll
NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Navigation
Declaration
Property Value
Type | Default | Description |
---|---|---|
Int32 | 0 | An integer that specifies the number of field values to display for the current column or row field. |
Remarks
PivotGridControl allows you to display top field values according to the current sort order, while ignoring values that follow these first values.
If the TopValueCount property is set to 0, PivotGridControl displays all values of the current row field (or column field) along the control’s left (or top) edge.
If the PivotGridFieldBase.TopValueType property is set to PivotTopValueType.Absolute, the TopValueCount property determines the absolute number of top field values to display. For instance, if there are 20 unique field values and the TopValueCount property is set to 10, only the 10 top field values will be displayed.
If the PivotGridFieldBase.TopValueType property is set to PivotTopValueType.Percent, the effect depends on the current data binding mode as follows:
- In a regular data binding mode, the TopValueCount property determines the number of field values to display relative to the total number of field values. For instance, if there are 20 unique field values and the TopValueCount property is set to 10, only 2 top field values (10% out of 20) will be displayed.
- In an OLAP mode, PivotGridControl will display top values whose cumulative total is equal to or greater than a specified percentage. For instance, if the TopValueCount property is set to 10, PivotGridControl will display values whose cumulative total is not less than 10% of the Grand Total value.
The TopValueCount property, along with the Sorting by Summary feature, allows you to implement a Top N Values report, which will show only the first records while ignoring the rest. The Top Values demo illustrates this functionality.
To learn more, for the WinForms Pivot Grid see Displaying Top N Values for a Field. For the ASP.NET Pivot Grid see Display Top N Values.
Note
In OLAP mode, totals are calculated against all values, even if the Top N Values feature is enabled.