Dear visitor, despite the COVID-19 outbreak, our team continues operating at full speed.

Also, here is the form where you can apply for a special discount and we will contact you with possible options. Stay safe and continue achieving your business goals.

Fill the form
Get Free Trial
Get Free Trial
  1. API reference
  2. Welcome
    1. Component overview
    2. Quick start
    3. System requirements
    4. Troubleshooting
    5. Managing license keys
    6. Migrating from WebDataRocks to Flexmonster
  3. Connecting to Data Source
    1. JSON
      1. Connecting to JSON
      2. Connecting to JSON using Flexmonster Data Server
      3. Data types in JSON
    2. CSV
      1. Connecting to CSV
      2. Connecting to CSV using Flexmonster Data Server
      3. Data types in CSV
    3. Database
      1. Connecting to SQL databases
      2. Connecting to a MySQL database
      3. Connecting to a Microsoft SQL Server database
      4. Connecting to a PostgreSQL database
      5. Connecting to an Oracle database
      6. Connecting to other databases
    4. MongoDB
      1. Introduction to Flexmonster MongoDB Connector
      2. Getting started with the MongoDB Connector
      3. Embedding the MongoDB Connector into the server
    5. Microsoft Analysis Services
      1. Connecting to Microsoft Analysis Services
      2. Getting started with the Accelerator
      3. Installing the Accelerator as a Windows service
      4. Referring the Accelerator as a DLL
      5. Configuring the authentication process
      6. Configuring a secure HTTPS connection
      7. Troubleshooting
    6. Pentaho Mondrian
      1. Connecting to Pentaho Mondrian
      2. Getting started with the Accelerator
      3. Configuring Mondrian roles
      4. Configuring username/password protection
      5. Configuring a secure HTTPS connection
      6. Troubleshooting
    7. Elasticsearch
      1. Connecting to Elasticsearch
      2. Configuring the mapping
    8. Custom data source API
      1. Introduction to the custom data source API
      2. A quick overview of a sample Node.js server
      3. A quick overview of a sample .NET Core server
      4. Implementing the custom data source API server
      5. Implementing filters
      6. Supporting more aggregation functions
      7. Returning data for the drill-through view
    9. Flexmonster Data Server
      1. Getting started with Flexmonster Data Server
      2. Installation guide
      3. Configurations reference
      4. Data sources guide
      5. Security and authorization guide
      6. The Data Server as a DLL
        1. Getting started with the Data Server as a DLL
        2. Referring the Data Server as a DLL
        3. Implementing the API controller
        4. DLL configurations reference
  4. Security
    1. Security in Flexmonster
    2. Security aspects of connecting to an OLAP cube
      1. Ways of connecting to an OLAP cube
      2. The data transfer process
      3. Data security
      4. Data access management
  5. Configuring report
    1. What is a report
    2. Data source
    3. Slice
    4. Options
    5. Mapping
    6. Number formatting
    7. Conditional formatting
    8. Set the report for the component
    9. Get the report from the component
    10. Date and time formatting
    11. Configuring global options
    12. Export and print
    13. Calculated values
    14. Custom sorting
  6. Integration with frameworks
    1. Available tutorials
    2. Integration with AngularJS (v1.x)
    3. Integration with Angular
    4. Integration with React
    5. Integration with React Native
    6. Integration with Vue
    7. Integration with Python
      1. Integration with Django
      2. Integration with Jupyter Notebook
    8. Integration with R Shiny
    9. Integration with Webpack
    10. Integration with ASP.NET
    11. Integration with jQuery
    12. Integration with JSP
    13. Integration with TypeScript
    14. Integration with Ionic
    15. Integration with RequireJS
    16. Integration with PhoneGap
  7. Charts
    1. Flexmonster Pivot Charts
    2. Integration with Highcharts
    3. Integration with Google Charts
    4. Integration with FusionCharts
    5. Integration with any charting library
  8. Customizing
    1. Customizing the Toolbar
    2. Customizing appearance
    3. Customizing the context menu
    4. Customizing the grid
    5. Localizing the component
  9. Updating to the latest version
    1. Updating to the latest version
    2. Release notes
    3. Migration guide from 2.7 to 2.8
    4. Migration guide from 2.6 to 2.7
    5. Migration guide from 2.5 to 2.6
    6. Migration guide from 2.4 to 2.5
    7. Migration guide from 2.3 to 2.4
    8. Migration guide from 2.2 to 2.3
    9. Documentation for older versions
Table of contents

Slice

A slice is a definition of the subset of data from your data source that will be shown in your report when you open it. By using slices in a report you can easily switch between different sets of values. Read more in the following sections:

Slice properties

You can define fields that go to rows, go to columns, go to measures, add filtering, sorting, report filtering, expands, and drills. Here is a list of all available properties for a slice:

  • columns – Array of objects. A list of hierarchies selected in the report slice for columns. Each object can have the following properties:
    • uniqueName – String. The hierarchy’s unique name.
    • caption (optional) – String. The hierarchy’s caption.
    • dimensionName (optional) – String. The 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 or on the chart.
    • sort (optional) – String. The sorting type for members ("asc", "desc" or "unsorted").
    • sortOrder (optional) – Array of strings. Set custom ordering for hierarchy members. Only for "csv" and "json" data source types. sortOrder can be specified like this: ["member_1", "member_2", etc.].
  • drills (optional) – Object. Contains drill-down information in multi-level hierarchies.
    • drillAll (optional) – Boolean. Indicates whether all levels of all hierarchies in the slice will be drilled down (true) or drilled up (false).
    • columns (optional) – Array of objects. Used to save and restore drilled down columns.
    • rows (optional) – Array of objects. Used to save and restore drilled down rows.
  • drillThrough (optional) – Array of strings. Allows pre-defining the slice for the drill-through view. Only for "csv", "json", and "api" data source types. drillThrough can be specified like this: ["Hierarchy name 1", "Hierarchy name 2", etc.] (see live demo).
  • expands (optional) – Object. Stores information about the expansion of nodes.
    • expandAll (optional) – Boolean. Indicates whether all nodes in the data tree will be expanded (true) or collapsed (false) on the grid and on the charts.
    • columns (optional) – Array of objects. Used to save and restore expanded columns.
    • rows (optional) – Array of objects. 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 multi-column 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").
    Note: the hierarchies are sorted in the order they were specified (i.e., the first hierarchy is sorted first, and so on). Therefore, take the element’s order into account when defining the flat table multi-column sorting. See the example on JSFiddle.
    To perform multi-column sorting via UI, use Ctrl+click.
  • measures – Array of objects. A list of the selected measures and those which have non-default properties. Each object has these properties:
    • uniqueName – String. The measure’s unique name.
    • active (optional) – Boolean. Indicates whether the measure will be selected for the report (true) or not (false). active: false can be useful if the measure has non-default properties, but should not be selected for the grid or the chart.
    • aggregation (optional) — String. The name of the 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 the measure is calculated, aggregation will be set to "none".
    • availableAggregations (optional) — Array of strings. Note that starting from version 2.8, the availableAggregations property is considered deprecated. Use the Mapping’s aggregations property instead.
      availableAggregations represents the list of aggregation functions that can be applied to the current measure. If the measure is calculated, availableAggregations will be set to [].
    • caption (optional) – String. The measure’s caption.
    • formula (optional) – String. Represents the formula. Refers to the calculated measure. It can contain the following operators: +, -, *, /. 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. 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. Refers to the calculated measure. Defines whether the formula is calculated using NaN values (true) or using null values (false). Default value: true.
    • format (optional) – String. The name of the number formatting that will be applied to the measure. Measure values can be formatted according to the number formatting defined in the report. All available number formattings are stored in the formats array in the report. More information about the number formatting part of the report can be found in the number formatting article.
    • grandTotalCaption (optional) – String. The measure’s 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. The hierarchy’s unique name.
    • properties – Array of strings. Represents the properties to 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. The hierarchy’s unique name.
    • caption (optional) – String. The hierarchy’s caption.
    • dimensionName (optional) – String. The 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 or on the chart.
    • sort (optional) – String. The sorting type for members ("asc", "desc" or "unsorted").
    • sortOrder (optional) – Array of strings. Set custom ordering for hierarchy members. Only for "csv" and "json" data source types. sortOrder can be specified like this: ["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. The hierarchy’s unique name.
    • caption (optional) – String. The hierarchy caption.
    • dimensionName (optional) – String. The 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 or on the chart.
    • sort (optional) – String. The sorting type for members ("asc", "desc" or "unsorted").
    • sortOrder (optional) – Array of strings. Set custom ordering for hierarchy members. Only for "csv" and "json" data source types. sortOrder can be specified like this: ["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. This object has 3 properties:
      • tuple – Array of strings. Consists of unique names that identify the column in the table based on the column’s data.
      • measure – Object. Identifies the measure on which sorting will be applied. Has the following properties:
        • uniqueName – String. The measure’s unique name.
        • aggregation (optional) – String. The measure’s aggregation type.
      • type – String. The sorting type ("asc" or "desc").
    • row – Object. Defines the sorting for numbers in a specific row. This object has 3 properties:
      • tuple – Array of strings. Consists of unique names that identify the row in the table based on the row’s data.
      • measure – Object. Identifies the measure on which sorting will be applied. Has the following properties:
        • uniqueName – String. The measure’s unique name.
        • aggregation (optional) – String. The measure’s aggregation type.
      • type – String. The sorting type ("asc" or "desc").

Default slice

If a slice was not defined, Flexmonster will select a default slice for the report, where the first hierarchy from the data goes to rows and the first measure goes to columns. The automatic default slice selection is available for JSON and CSV data sources (it is not available for OLAP). You can turn off the default slice by setting showDefaultSlice in options to false. For example, take a look at the JSON data below:

var jsonData =  [
{
"Category": "Accessories",
"Price": 125,
"Quantity": 100
},
{
"Category": "Accessories",
"Price": 74,
"Quantity": 235
},
{
"Category": "Bikes",
"Price": 233,
"Quantity": 184
}
]

"Category" is the first hierarchy, so it goes to rows. "Price" is the first measure, so it goes to columns. For this dataset, the default slice will look like this:

{
"dataSource": {
"data": jsonData
},
"slice": {
"rows": [
{
"uniqueName": "Category"
}
],
"columns": [
{
"uniqueName": "[Measures]"
}
],
"measures": [
{
"uniqueName": "Price"
}
]
}
}

See the same example with a default slice on JSFiddle.

Rows, columns, and measures

Starting from version 2.304, a slice can be defined with only measures:

{
"dataSource": {
"filename": "http://www.flexmonster.com/download/data.csv"
},
"slice": {
"measures": [
{
"uniqueName": "Price",
"aggregation": "sum",
"active": true
}
]
}
}

Open on JSFiddle.

"uniqueName": "[Measures]" allows you to define where the measures will be displayed (in rows or in columns). By default they go to columns. Here is an example of a slice with rows, columns, and measures:

{
"dataSource": {
"filename": "http://www.flexmonster.com/download/data.csv"
},
"slice": {
"rows": [
{
"uniqueName": "Category",
"filter": {
"members": [
"category.[cars]",
"category.[bikes]"
]
},
"sort": "desc"
}
],
"columns": [
{
"uniqueName": "[Measures]"
},
{
"uniqueName": "Color",
"filter": {
"members": [
"color.[blue]"
]
}
}
],
"measures": [
{
"uniqueName": "Price",
"aggregation": "sum",
"active": true
},
{
"uniqueName": "Discount",
"aggregation": "min",
"active": true
}
]
}
}

See the same example on JSFiddle.

Report filter

A report filter allows you to display different data subsets in the report. In Flexmonster Pivot the reportFilters property is used for defining the report filters as follows:

{
"dataSource": {
"filename": "http://www.flexmonster.com/download/data.csv"
},
"slice": {
"reportFilters": [
{
"uniqueName": "Color",
"filter": {
"members": [
"color.[yellow]",
"color.[white]"
]
}
}
],
"rows": [
{
"uniqueName": "Category"
}
],
"columns": [
{
"uniqueName": "[Measures]"
}
],
"measures": [
{
"uniqueName": "Price"
}
]
}
}

See an example with a report filter on JSFiddle.

Sorting

The sorting object defines the sorting for numbers in a specific row and/or column in the pivot table. Sorting is usually configured on the grid and then saved within the report. It looks like this:

"sorting": {
"column": {
"type": "desc",
"tuple": [],
"measure": "Price"
}
}

Sorting for members of columns and rows is defined like this:

"rows": [
{
"uniqueName": "Category",
"filter": {
"members": [
"category.[cars]",
"category.[bikes]"
]
},
"sort": "desc"
}
]

Expands

Information about expands and collapses is stored within the slice. When a customer performs one of these operations, all the changes can be saved within the report. Use the expandAll property to apply the operation to all levels of data detail at once. This is how an expands object looks:

"expands": {
"expandAll": false,
"rows": [
{
"tuple": [
"category.[accessories]"
]
},
{
"tuple": [
"category.[cars]"
]
}
]
}

Drills

The drills object is used to store information about drill-downs in multi-level hierarchies. Here is an example of a drills object:

"drills": {
"drillAll": false,
"rows": [
{
"tuple": [
"category.[accessories]"
]
},
{
"tuple": [
"category.[accessories].[bike racks]"
]
},
{
"tuple": [
"category.[accessories].[bottles and cages]"
]
}
]
}

Calculated values

You can create as many calculated measures for one report as you need. When you save the report all the calculated measures will be saved as well and loaded when the report is retrieved. Note that you can add calculated measures only for reports that are based on a "csv", "json", or "api" data source type. Below is an example of a calculated measure:

"measures": [
{
"uniqueName": "Avg",
"formula": "sum('Price') / count('Category') ",
"caption": "Avg",
"active": true
}
]

Change a slice using the Field List and controls on the grid

Use the Field List to define report filters, rows, columns, and values at run time.

fieldslist

Sorting, filtering, drill-ups, drill-downs, and expand/collapse operations are available directly on the grid and on built-in pivot charts.

Slice via API

You can change the slice along with other report parts using the API call setReport(). To change only the slice use the runQuery() call.