🎉 Flexmonster Pivot Table & Charts v2.8 has arrived!Read the blog post
Get Free Trial
Get Free Trial
  1. API reference
    1. Introduction
    2. Flexmonster()
  2. Objects
    1. All objects
    2. Report Object
    3. Data Source Object
    4. Mapping Object
    5. Slice Object
    6. Options Object
    7. Filtering
      1. Filter Object
      2. Number Query Object
      3. String Query Object
      4. Date Query Object
      5. Time Query Object
      6. Value Query Object
    8. Format Object
    9. Conditional Format Object
    10. Cell Data Object
    11. Chart Data Object
    12. Toolbar Object
  3. Methods
    1. All methods
    2. addCalculatedMeasure
    3. addCondition
    4. alert
    5. clear
    6. clearFilter
    7. clearXMLACache
    8. closeFieldsList
    9. collapseAllData
    10. collapseData
    11. connectTo
    12. customizeAPIRequest
    13. customizeCell
    14. customizeContextMenu
    15. dispose
    16. expandAllData
    17. expandData
    18. exportTo
    19. getAllConditions
    20. getAllHierarchies
    21. getAllMeasures
    22. getCell
    23. getColumns
    24. getCondition
    25. getFilter
    26. getFormat
    27. getMeasures
    28. getMembers
    29. getOptions
    30. getReport
    31. getReportFilters
    32. getRows
    33. getSelectedCell
    34. getSort
    35. getXMLACatalogs
    36. getXMLACubes
    37. getXMLADataSources
    38. getXMLAProviderName
    39. load
    40. off
    41. on
    42. open
    43. openCalculatedValueEditor
    44. openFieldsList
    45. openFilter
    46. print
    47. refresh
    48. removeAllCalculatedMeasures
    49. removeAllConditions
    50. removeCalculatedMeasure
    51. removeCondition
    52. removeSelection
    53. runQuery
    54. save
    55. setFilter
    56. setFormat
    57. setOptions
    58. setReport
    59. setSort
    60. showCharts
    61. showGrid
    62. showGridAndCharts
    63. sortingMethod
    64. sortValues
    65. updateData
  4. Events
    1. All events
    2. afterchartdraw
    3. aftergriddraw
    4. beforegriddraw
    5. beforetoolbarcreated
    6. cellclick
    7. celldoubleclick
    8. chartclick
    9. datachanged
    10. dataerror
    11. datafilecancelled
    12. dataloaded
    13. drillthroughclose
    14. drillthroughopen
    15. exportcomplete
    16. exportstart
    17. fieldslistclose
    18. fieldslistopen
    19. filterclose
    20. filteropen
    21. loadingdata
    22. loadinglocalization
    23. loadingolapstructure
    24. loadingreportfile
    25. localizationerror
    26. localizationloaded
    27. olapstructureerror
    28. olapstructureloaded
    29. openingreportfile
    30. printcomplete
    31. printstart
    32. querycomplete
    33. queryerror
    34. ready
    35. reportchange
    36. reportcomplete
    37. reportfilecancelled
    38. reportfileerror
    39. runningquery
    40. update
  5. Custom API requests
    1. All requests
    2. /handshake request
    3. /fields request
    4. /members request
    5. /select request for pivot table
    6. /select request for flat table
    7. /select request for drill-through view
    8. Field Object
  6. MongoDB Connector API
    1. All methods
    2. getSchema
    3. getMembers
    4. getSelectResult
Table of contents

Slice Object

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, hierarchy unique name.
    • caption (optional) – String, hierarchy caption;
    • dimensionName (optional) – String, dimension name;
    • filter (optional) – Filter Object. Contains filtering information.
    • levelName (optional) – String. Used to specify the level of the hierarchy that is shown on the grid.
    • sort (optional) – String, 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.].
  • drills (optional) – Object. Stores the information about drill-downs in multilevel hierarchies.
    • drillAll (optional) – Boolean. 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" and "json" 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.
  • 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, measure unique name.
    • active (optional) – Boolean 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, unique name of aggregation that will be applied to the measure ("sum", "count", "distinctcount", "average", "median", "product", "min", "max", "percent", "percentofcolumn", "percentofrow", "percentofparentrowtotal", "percentofparentcolumntotal", "index", "difference", "%difference", "runningtotals", "stdevp", "stdevs"). If it is calculated measure, it will be "none".
    • availableAggregations (optional) — Array of strings that represents the list of aggregation functions which can be applied to the current measure. If it is calculated measure, it will be [].
      Note that starting from version 2.8, the availableAggregations property is considered deprecated. Use the Mapping object’s aggregations property instead.
    • caption (optional) – String, measure caption.
    • formula (optional) – String that represents the formula that can contain the following operations: +, -, *, / (check a full list); other measures can be addressed using measure unique name and aggregation function, for example sum("Price") or max("Order"). Pivot supports the following aggregation functions for CSV and JSON data sources: "sum", "count", "distinctcount", "average", "median", "product", "min", "max", "percent", "percentofcolumn", "percentofrow", "percentofparentrowtotal", "percentofparentcolumntotal", "index", "difference", "%difference", "runningtotals", "stdevp", "stdevs".
    • individual (optional) – Boolean. Defines whether the formula is calculated using raw values (true) or using aggregated values (false). 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, name of number formatting.
    • grandTotalCaption (optional) – String, 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).
  • memberProperties – Array of objects. Each object has the following properties:
    • levelName – String, hierarchy unique name.
    • properties – Array of 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. Hierarchy unique name.
    • caption (optional) – String, hierarchy caption;
    • dimensionName (optional) – String, dimension name;
    • filter (optional) – Filter Object. Contains filtering information.
    • levelName (optional) – String. Used to specify the level of the hierarchy that is shown on the grid.
    • sort (optional) – String. 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, hierarchy unique name.
    • caption (optional) – String, hierarchy caption;
    • dimensionName (optional) – String, dimension name;
    • filter (optional) – Filter Object. Contains filtering information.
    • levelName (optional) – String. Used to specify the level of the hierarchy that is shown on the grid.
    • sort (optional) – String, 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. Measure unique name.
        • aggregation (optional) – String. Measure aggregation type.
      • type – String. 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 identifies 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. Measure unique name.
        • aggregation (optional) – String. Measure aggregation type.
      • type – String. 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.