workbook.PivotAxis

Object Description

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

Use workbook.createPivotAxis(options) to create this object.

A pivot axis object is used as a parameter in the workbook.createPivot(options) method.

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. Also see Full scripts in the Tutorial: Creating a Workbook Using the Workbook API topic.

            // 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

General Notices