workbook.PivotAxis

Note:

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

Object Description

A pivot axis. A pivot axis is used with you create a pivot definition.

You can create a pivot axis using workbook.createPivotAxis(options).

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/workbook Module

Methods and Properties

PivotAxis Object Members

Since

2020.2

Syntax

Important:

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.

            // Add additional code
...
// Create a basic Section-based PivotAxis
var myPivotAxis = workbook.createPivotAxis({
    root: mySection
});

// Create a basic DataDimension-based PivotAxis
var myPivotAxis = workbook.createPivotAxis({
    root: myDataDimension
});

// Create a sorted Section-based PivotAxis
var myPivotAxis = workbook.createPivotAxis({
    root: mySection,
    sortDefinitions: [mySortDefinition]
});

// Create a sorted DataDimension-based PivotAxis
var myPivotAxis = workbook.createPivotAxis({
    root: myDataDimension,
    sortDefinitions: [mySortDefinition]
});

// View a workbook.PivotAxis used in a PivotDefinition
var myWorkbook = workbook.load ({
    id: myWorkbookId
});

var myPivotAxis = pivotDefinitions[0].rowAxis.root;

// Note that some PivotAxis properties may be empty/null based on the loaded workbook
log.audit({
    title: 'PivotAxis root = ',
    details: myPivotAxis.root
});
log.audit({
    title: 'PivotAxis sortDefinitions = ',
    details: myPivotAxis.sortDefinitions
});
...
// Add additional code 

          

Related Topics

N/workbook Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices