Slice is a definition of what data subset from the data source is going to be shown in the report. This object has the following properties:
columns
– Array of objects. A list of hierarchies selected in the report slice for columns. Each object can have the following properties: uniqueName
– String. A hierarchy unique name.caption
(optional) – String. A hierarchy caption.dimensionName
(optional) – String. A dimension name.filter
(optional) – Filter Object. It contains filtering information.levelName
(optional) – String. It used to specify the level of the hierarchy that is shown on the grid.showTotals
(optional) — Boolean. Defines whether totals are shown or hidden for the hierarchy. When set to true
, totals are shown. Only for the classic view.showTotals
is not specified, totals’ visibility is defined by the options.showTotals
property. Learn more about options.showTotals.sort
(optional) – String. A sorting type for the members ("asc"
, "desc"
or "unsorted"
).sortOrder
(optional) – Array. Using this property you can set custom sorting for hierarchy members. You can specify sortOrder
the following way: ["member_1", "member_2", etc.]
. Only for "csv"
and "json"
data source types. drills
(optional) – Object. Stores the information about drill-downs in multilevel hierarchies:drillAll
(optional) – Boolean. It indicates whether all levels of all hierarchies in slice will be drilled down (true
) or drilled up (false
).columns
(optional) – Array of objects. It is used to save and restore drilled down columns.rows
(optional) – Array of objects. It is used to save and restore drilled down rows. drillThrough
(optional) – Array. It allows pre-defining slice for the drill-through view. Only for "csv"
, "json"
, and "api"
data source types. Can be specified the following way: ["Hierarchy name 1", "Hierarchy name 2", etc.]
(see live demo). expands
(optional) – Object. Stores the information about expanded nodes:expandAll
(optional) – Boolean. Indicates whether all nodes in the data tree will be expanded (true
) or collapsed (false
) on the grid and on charts.columns
(optional) – Array of objects. It is used to save and restore expanded columns.rows
– Array of objects. It is used to save and restore expanded rows. flatSort
– Array of objects. Only for "json"
, "csv"
, and "api"
data source types. It contains the list of objects defining the multicolumn sorting on the flat grid. Each object has the following properties:uniqueName
– String. The unique name of the hierarchy being sorted. sort
– String. The sorting type ("asc"
, "desc"
, or "undefined"
).Ctrl+click
.measures
– Array of objects. A list of selected measures and those which have different properties from default ones. Each object has the following properties: uniqueName
– String. A measure unique name.active
(optional) – Boolean. A value that defines whether the measure will be in the list of available values but not selected (false
) or will be selected for the report (true
).aggregation
(optional) — String. A unique name of aggregation that will be applied to the measure. To see the list of supported aggregation functions for each data source type, refer to Flexmonster’s technical specifications. If it is a calculated
measure, it will be "none"
.availableAggregations
(optional) — Array of strings. Note that starting from version 2.8, the availableAggregations
property is considered deprecated. Use the Mapping object’s aggregations
property instead.availableAggregations
represents the list of aggregation functions which can be applied to the current measure. If it is a calculated
measure, it will be []
.caption
(optional) – String. A measure caption.formula
(optional) – String. Represents the formula. Refers to the calculated measure. It can contain the following operators: +
, -
, *
, /
(check a full list). Other measures can be referenced using the measure’s unique name and the associated aggregation function, for example sum("Price")
or max("Order")
. To see the list of supported aggregation functions for each data source type, refer to Flexmonster’s technical specifications. individual
(optional) – Boolean. It refers to the calculated measure. Defines whether the formula is calculated using raw values (true
) or using aggregated values (false
). Only for "json"
and "csv"
data source types. Default value: false
.calculateNaN
(optional) – Boolean. Defines whether the formula is calculated using the NaN values (true
) or using the null values (false
). Default value: true
.format
(optional) – String. A name of number formatting.grandTotalCaption
(optional) – String. A measure grand total caption. flatOrder
– Array of strings. Defines the order of the hierarchies for the "flat"
grid type. flatOrder
can be specified like this: ["Hierarchy name 1", "Hierarchy name 2", etc.]
(see live demo). Only for "json"
, "csv"
, and "api"
data source types. memberProperties
– Array of objects. Only for "microsoft analysis services"
and "mondrian"
data source types. Each object in the array has the following properties: levelName
– String. A hierarchy unique name.properties
– Array. It contains member properties, which will be shown on the grid. Other available member properties can be accessed through the context menu. reportFilters
– Array of objects. A list of hierarchies selected in the report slice for Report Filters. Each object has the following properties: uniqueName
– String. A hierarchy unique name.caption
(optional) – String. A hierarchy caption.dimensionName
(optional) – String. A dimension name.filter
(optional) – Filter Object. It contains filtering information.levelName
(optional) – String. Used to specify the level of the hierarchy that is shown on the grid.sort
(optional) – String. A sorting type for the members ("asc"
, "desc"
or "unsorted"
).sortOrder
(optional) – Array. Using this property you can set custom sorting for hierarchy members. Only for "csv"
and "json"
data source types. You can specify sortOrder
the following way: ["member_1", "member_2", etc.]
. rows
– Array of objects. A list of hierarchies selected in the report slice for rows. Each object can have the following properties: uniqueName
– String. A hierarchy unique name.caption
(optional) – String. A hierarchy caption.dimensionName
(optional) – String. A dimension name.filter
(optional) – Filter Object. It contains filtering information.levelName
(optional) – String. Used to specify the level of the hierarchy that is shown on the grid.showTotals
(optional) — Boolean. Defines whether totals are shown or hidden for the hierarchy. When set to true
, totals are shown. Only for the classic view.showTotals
is not specified, totals’ visibility is defined by the options.showTotals
property. Learn more about options.showTotals.sort
(optional) – String. A sorting type for the members ("asc"
, "desc"
or "unsorted"
).sortOrder
(optional) – Array. Using this property you can set custom sorting for hierarchy members. Only for "csv"
and "json"
data source types. You can specify sortOrder
the following way: ["member_1", "member_2", etc.]
. sorting
(optional) – Object. Defines the sorting for numbers in a specific row and/or column in the pivot table. column
– Object. Defines the sorting for numbers in a specific column. Object has 3 properties: tuple
– Array. Consists of unique names that identifies the column in the table based on data in it.measure
– Object. Identifies the measure on which sorting will be applied. Has the following properties: uniqueName
– String. A measure’s unique name.aggregation
(optional) – String. A measure aggregation type. type
– String. A sorting type ("asc"
or "desc"
). row
– Object. Defines the sorting for numbers in a specific row. Object has 3 properties: tuple
– Array. Consists of unique names that identify the row in the table based on data in it.measure
– Object. Identifies the measure on which sorting will be applied. Has the following properties: uniqueName
– String. A measure unique name.aggregation
(optional) – String. A measure aggregation type. type
– String. A sorting type ("asc"
or "desc"
). Change the slice using runQuery() and setReport() API calls. Get the slice among with other report parts using getReport().
Find more details about Slice Object in this tutorial with examples.