workbook.createMeasureSort(options)

Note:

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

Method Description

Creates a measure sort, which defines a sort on a measure.

Returns

workbook.MeasureSort

Supported Script Types

Server scripts

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

Governance

None

Module

N/workbook Module

Sibling Module Members

N/workbook Module Members

Since

2020.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.measure

workbook.Measure

required

The measure for the measure sort.

options.otherAxisSelector

workbook.DimensionSelector | workbook.PathSelector

required

The selector for the other axis of the measure sort.

options.selector

workbook.DimensionSelector | workbook.PathSelector

required

The selector of the measure sort. This corresponds to the MeasureSort.sort property.

options.sort

workbook.Sort

required

The sort for the measure sort.

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 DimensionSelector-DimensionSelector MeasureSort
var myMeasureSort = workbook.createMeasureSort({
    measure: myMeasure,
    selector: myDimensionSelector,
    otherAxisSelector: myOtherDimensionSelector,
    sort: mySort
});
// Create a PathSelector-PathSelector MeasureSort
var myMeasureSort = workbook.createMeasureSort({
    measure: myMeasure,
    selector: myPathSelector,
    otherAxisSelector: myOtherPathSelector,
    sort: mySort
});

// Create a DimensionSelector-PathSelector MeasureSort
var myMeasureSort = workbook.createMeasureSort({
    measure: myMeasure,
    selector: myDimensionSelector,
    otherAxisSelector: myPathSelector,
    sort: mySort
});
// Create a PathSelector-DimensionSelector MeasureSort
var myMeasureSort = workbook.createMeasureSort({
    measure: myMeasure,
    selector: myPathSelector,
    otherAxisSelector: myDimensionSelector,
    sort: mySort
});

// Create a DimensionSelector-AllSubNodesSelector MeasureSort
var myMeasureSort = workbook.createMeasureSort({
    measure: myMeasure,
    selector: myDimensionSelector,
    otherAxisSelector: myAllSubNodesSelector,
    sort: mySort
});

// Create a AllSubNodeSelector-DimensionSelector MeasureSort
var myMeasureSort = workbook.createMeasureSort({
    measure: myMeasure,
    selector: myAllSubNodesSelector,
    otherAxisSelector: myDimensionSelector,
    sort: mySort
});

// Create a AllSubNodeSelector-PathSelector MeasureSort
var myMeasureSort = workbook.createMeasureSort({
    measure: myMeasure,
    selector: myAllSubNodesSelector,
    otherAxisSelector: myPathSelector,
    sort: mySort
});
...
// Add additional code 

          

Related Topics

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

General Notices