Data Dimensions

Note:

The content in this help topic applies to SuiteScript 2.x.

Data dimensions let you analyze and format the data in a pivot from specific columns in the underlying dataset. You can create data dimensions to see how one column’s data relates to another column’s data. For example, you can create data dimensions for transaction type and posting period to analyze the number of transaction types per posting period in a pivot.

For more information about data dimensions in SuiteAnalytics Workbook, see Workbook Pivot Tables.

To create a data dimension, first use workbook.createDataDimensionItem(options) to create items to include in the data dimension. This method creates a workbook.DataDimensionItem object. Each data dimension item represents a column in the dataset that has data you want to analyze. When you use this method, you must provide the following parameters:

          var myItem = workbook.createDataDimensionItem({
    expression: myDataset.getExpressionFromColumn({
        alias: 'MyColumn'
    }),
    label: 'My Item'
}); 

        

After you create a set of data dimension items, use workbook.createDataDimension(options) to assemble the set of items into a single workbook.DataDimension object. You can use the optional children parameter to specify child data dimensions or measures, and you can use the optional totalLine parameter to define how the total line appears using values from the workbook.TotalLine enum.

          var myDataDimension = workbook.createDataDimension({
    children: [myFirstDDChild, mySecondDDChild],
    items: [myFirstDDItem, mySecondDDItem],
    totalLine: workbook.TotalLine.HIDDEN
}); 

        

You can provide an array of workbook.DataDimension objects when you create pivot axes using workbook.createPivotAxis(options). For more information, see Pivot Axes.

          var myColumnAxis = workbook.createPivotAxis({
    root: workbook.createSection({
        children: [myDataDimension]
    }),
    sortDefinitions: [mySortDefinition];
}); 

        

Related Topics

Data Measures and Calculated Measures
Expressions
Pivot Axes
Selectors
Styles
Pivots

General Notices