workbook.createConditionalFilter(options)
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 |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2020.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
required |
The selector for the conditional filter. |
|
|
required |
The measure for the conditional filter. |
|
|
required |
The other axis selector for the conditional filter. |
|
|
required |
The predicate for the conditional filter. |
|
|
boolean |
required |
Indicator for a row axis filter. If set to false, the filter is a on a column axis. |
Syntax
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 ConditionalFilter
var myConditionalFilter = workbook.createConditionalFilter({
row: true,
otherAxisSelector: myDimensionSelector, // previously created workbook.PathSelector or workbook.DimensionSelector objtect
filteredNodesSelector: myPathSelector, // previously created workbook.PathSelector or workbook.DimensionSelector objtect
measure: myMeasure, // previously created workbook.Measure object
predicate: myExpression // previously created workbook.Expression object
});
...
// Add additional code