Menu
Download Free Trial
Table of contents

setTopX

setTopX(hiearchyName:String, num:Number, measureName:String)

[starting from version: 1.4]

Sets the Top X filter for the specified hierarchy and measure.

Parameters

  • hierarchyName – the name of the hierarchy.
  • num – number of elements to choose.
  • measureName – the name of the measure on which Top X filter will be applied.

Example

flexmonster.setTopX("Category", 2, "Price");

flexmonster.getFilterProperties("Category");

/*
method getFilterProperties() returns the following object:
{
  type: "top",
  members: [],
  measure: "Price",
  quantity: 2
}
*/

flexmonster.getFilter("Category");

/*
method getFilter() returns the following Array:
[
  {caption: "Cars", hierarchyName: "Category", uniqueName: "category.[cars]"},
  {caption: "Bikes", hierarchyName: "Category", uniqueName: "category.[bikes]"}
]
*/

Open on JSFiddle.

See also

setBottomX
clearFilter
getFilter
getFilterProperties
setFilter