workbook.createConditionalFilter(options)

Note:

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

Method Description

Creates a conditional filter, which includes a selector of what to filter, a row axis and other axis, a measure and a predicate. Conditional filters can be used in pivot definitions.

Returns

workbook.ConditionalFilter

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.filteredNodesSelector

workbook.DimensionSelector | workbook.PathSelector

required

The selector for the conditional filter.

options.measure

workbook.Measure

required

The measure for the conditional filter.

options.otherAxisSelector

workbook.DimensionSelector | workbook.PathSelector

required

The other axis selector for the conditional filter.

options.predicate

workbook.Expression

required

The predicate for the conditional filter.

options.row

boolean

required

Indicator for a row axis filter. If set to false, the filter is a on a column axis.

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 ConditionalFilter
var myConditionalFilter = workbook.createConditionalFilter({
    row: true,
    otherAxisSelector: myDimensionSelector,
    filteredNodesSelector: myPathSelector,
    measure: myMeasure,
    predicate: myExpression
});
...
// Add additional code 

          

Related Topics

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

General Notices