Modules

filter

 

Objects/Functions

module (N/workbook)

SuiteScript 2.0

workbook.MeasureSort

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=workbook.MeasureSort for more information.

N/workbook Module
workbook.MeasureSort
Object Description: A measure sort. A measure sort can be used when you create a limiting filter or a sort definition. You can create a measure sort using workbook.createMeasureSort(options).
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/workbook Module
Methods and Properties: MeasureSort Object Members
Since: 2020.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=workbook.MeasureSort

Example:

// Code Example 1
// 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
});

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

var myMeasureSort = myWorkbook.chartDefinitions[0].category.sortDefinitions[0].sortBys[0];

// Note that some MeasureSort properties may be empty/null based on the loaded workbook
log.audit({
title: 'MeasureSort.sort = ',
details: myMeasureSort.sort
});
log.audit({
title: 'MeasureSort.measure = ',
details: myMeasureSort.measure
});
log.audit({
title: 'MeasureSort.selector= ',
details: myMeasureSort.selector
});
log.audit({
title: 'MeasureSort.otherAxisSelector = ',
details: myMeasureSort.otherAxisSelector
});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159008368992.html