workbook.createDataDimension(options)
Method Description |
Creates a data dimension, which includes items, child data items, and a total line. A data dimension is used in a workbook.PivotAxis, a workbook.DimensionSelector, and a workbook.Section. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2020.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
Array<workbook.DataDimension | workbook.Section | workbook.Measure> |
optional |
The child data dimensions or sections of the data dimension. |
|
required |
The items of the data dimension. |
|
|
string |
optional |
The predefined formats for the total line. |
Errors
Error Code |
Thrown If |
---|---|
|
The value specified for the |
|
The |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/workbook Module Script Samples. Also see Full scripts in the Tutorial: Creating a Workbook Using the Workbook API topic.
// Add additional code
...
// Create a basic DataDimension
var myDataDimension = workbook.createDataDimension({
items: [myDataDimensionItem]
});
// Create a comprehensive DataDimension
var myDataDimension = workbook.createDataDimension({
totalLine: workbook.TotalLine.HIDDEN,
items: [myDataDimensionItem],
children: [mySection]
});
...
// Add additional code