Skip to main content

Top N

  • 2 minutes to read

The Top N feature allows you to display only a limited number of values that correspond to the highest or lowest values of a particular measure.

To display the top values in a dimension, select Top N from the data item menu.

DataShaping_TopN_MenuItem

This invokes the Top N Values dialog.

DataShaping_TopN_Dialog

In this dialog, check the Enabled check box and specify the following settings.

Mode

Specifies whether top or bottom values should be displayed.

Count

The number of values to be displayed.

Measure

The parameter according to which the top or bottom values will be determined.

Show “Others” value

If enabled, all values that are not the top/bottom ones are consolidated in the “Others” value.

Note

Note that this capability is not supported in OLAP mode.

You can use the hidden measure as a parameter according to which the top or bottom values will be determined.

To configure the Top N feature in code, use the Dimension.TopNOptions property. This property returns a DimensionTopNOptions object that exposes the following properties.

DimensionTopNOptions.Enabled

Gets or sets whether the Top N Values feature is enabled.

DimensionTopNOptions.Mode

Gets or sets whether the smallest or largest values should be displayed.

DimensionTopNOptions.Count

Gets or sets the number of top or bottom values to be displayed.

DimensionTopNOptions.Measure

Gets or sets the Measure by whose values the dimension values are ranged.

DimensionTopNOptions.ShowOthers

Gets or sets whether to show the “Others” value.

The following code snippet shows how to display 3 sales persons with the largest Extended Price summaries.

Dimension salesPersonDimension = new Dimension("Sales Person");
Measure extendedPriceMeasure = new Measure("Extended Price");
//...
salesPersonDimension.TopNOptions.BeginUpdate();
salesPersonDimension.TopNOptions.Enabled = true;
salesPersonDimension.TopNOptions.Count = 3;
salesPersonDimension.TopNOptions.Measure = extendedPriceMeasure;
salesPersonDimension.TopNOptions.EndUpdate();

Limitations

The “Others” value has the following limitations:

  • You cannot set the “Others” element as a Master Filter value.
  • Drill down by this value is not supported.
  • You cannot obtain Underlying data only for the “Others” value. As an alternative, use the Data Inspector to obtain underlying data for the whole dashboard item.

API Members

API Description
Dimension.TopNOptions Provides access to the Top N settings.
DimensionTopNOptions Contains the Top N settings.