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. Data types in JSON
    2. CSV
      1. Connecting to CSV
      2. Data types in CSV
    3. Database
      1. Connecting to SQL databases
      2. Connecting to other databases
      3. Connecting to a database with Node.js
      4. Connecting to a database with .NET
      5. Connecting to a database with .NET Core
      6. Connecting to a database with Java
      7. Connecting to a database with PHP
    4. 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
    5. 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
    6. Elasticsearch
      1. Connecting to Elasticsearch
      2. Configuring the mapping
  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
    3. Security aspects when connecting to a database
      1. Ways of connecting to a database
      2. The data transfer process
      3. 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 Webpack
    6. Integration with ASP.NET
    7. Integration with jQuery
    8. Integration with JSP
    9. Integration with TypeScript
    10. Integration with RequireJS
    11. Integration with PhoneGap
  7. Integration with charts
    1. Integration with Highcharts
    2. Integration with Google Charts
    3. Integration with FusionCharts
    4. Integration with any charting library
  8. Customizing
    1. Customizing the Toolbar
    2. Customizing appearance
    3. Customizing the context menu
    4. Localizing the component
  9. Updating to the latest version
    1. Updating to the latest version
    2. Release notes
    3. Migration guide from 2.6 to 2.7
    4. Migration guide from 2.5 to 2.6
    5. Migration guide from 2.4 to 2.5
    6. Migration guide from 2.3 to 2.4
    7. Migration guide from 2.2 to 2.3
    8. Documentation for older versions
Table of contents

Mapping

The Mapping Object allows defining field data types, captions, and multi-level hierarchies; grouping fields under separate dimensions and setting other view configurations of hierarchies from the CSV, JSON, and OLAP data sources.

It presents a powerful way to neatly separate a data source from its presentation.

For each field in the data source, you can set the following properties:

  • caption – the hierarchy’s caption.
  • type – the field’s data type. Can be:
    • "string" – the field stores string data. It can be aggregated only with count and distinctcount aggregations. Only for "csv" and "json" data sources.
    • "number" – the field stores numerical data. It can be aggregated with all the available aggregations. Only for "csv" and "json" data sources.
    • "level" – the field is a level of the hierarchy. This type is used together with other properties such as hierarchy, level, and parent. Only for "csv" and "json" data sources.
    • "month" – the field stores months. Only for "csv" and "json" data sources.
    • "weekday" – the field stores days of the week. Only for "csv" and "json" data sources.
    • "date" – the field stores a date. The field of this type is split into 3 different fields: Year, Month, Day. Only for "csv" and "json" data sources.
    • "date string" – the field stores a date. It can be formatted using the datePattern option (default is "dd/MM/yyyy"). Only for "csv" and "json" data sources.
    • "year/month/day" – the field stores a date. It’s displayed as a multi-level hierarchy with the following levels: Year > Month > Day. Only for "csv" and "json" data sources.
    • "year/quarter/month/day" – the field is a date. It’s displayed as a multi-level hierarchy with the following levels: Year > Quarter > Month > Day. Only for "csv" and "json" data sources.
    • "time" – the field stores time. It can be formatted using the timePattern option (default is "HH:mm:ss"). Only for "csv" and "json" data sources.
    • "datetime" – the field is a date. It can be formatted using the dateTimePattern option (default is "dd/MM/yyyy HH:mm:ss"). min, max, count, and distinctcount aggregations can be applied to it. Only for "csv" and "json" data sources.
    • "id" – the field is an id. The field of this type can be used for editing data. It’s not shown in the Field List. Only for "csv" and "json" data sources.
    • "hidden" – the field is hidden. The field of this type is not shown in the Field List. Only for "csv" and "json" data sources.
    • "property" – the field for setting member properties. This field is not shown in the Field List. For example, it can be used to associate a productID with a product. Only for a "json" data source. See the example.
  • hierarchy – the hierarchy’s name. This property is necessary to specify only if the field is a level of a hierarchy ("type": "level") or if the field is a member property of a hierarchy ("type": "property"). Only for "csv" and "json" data sources.
  • level – the level’s caption. This property can be specified only if the field is a level of hierarchy ("type": "level"). Only for "csv" and "json" data sources.
  • parent – the unique name of the parent level. This property can be specified only if the field is a level of hierarchy ("type": "level"). Only for "csv" and "json" data sources.
  • dimensionUniqueName – the dimension’s unique name. This property can be used to group several fields under one dimension. Only for "csv" and "json" data sources.
  • dimensionCaption – the dimension’s caption. This property specifies the name of a folder in the Field List under which several fields are grouped. Only for "csv" and "json" data sources.

Other ways to customize fields presentation

Another way to define how the fields are displayed in the report is by setting these configurations right in the data source. Please note that this approach is available only for CSV and JSON data sources. For more details, please refer to the Data types in CSV and Data types in JSON articles. It also should be noted that there are certain limitations in the case of CSV data source – not all the field properties can be customized using prefixes.

Thus, we strongly recommend preferring the Mapping Object to other types of fields’ customization.

Examples

1) See the demo on JSFiddle to learn how to set custom captions, hierarchy levels, and field data types in the JSON data source.

2) See the demo on JSFiddle to learn how to set custom captions, hierarchy levels, and field data types in the CSV data source.

3) See the demo on JSFiddle to learn how to set custom captions for hierarchies and measures for SSAS.

4) See the demo on JSFiddle to learn how to set custom captions for hierarchies and measures for Mondrian.