Conditions
Conditions in a dataset let you filter the dataset query results based on criteria that you specify. Conditions can filter entire records and fields from a dataset, which affects all workbooks that are based on that dataset.
For more information about conditions in SuiteAnalytics Workbook, see Dataset Criteria Filters.
To create a condition, use dataset.createCondition(options). This method creates a dataset.Condition object. You can create a condition using the following combinations of parameters:
-
column
,operator
, andvalues
– The column to apply the condition to, and an operator and values to use for the condition. Use dataset.createColumn(options) to create a column. Use values from the query.Operator enum (or their string equivalents). For more information, see Columns.var myCondition = dataset.createCondition({ column: myColumn, operator: query.Operator.EQUAL, values: ['Smith'] });
The
values
parameter is optional and should be included only for operators that use values. For example, thequery.Operator.EMPTY
operator does not require values. -
children
andoperator
– The child conditions to combine and an operator to use for the combination. You can use dataset.createCondition(options) to create individual conditions, then combine them using an AND or OR operation.var myCondition = dataset.createCondition({ children: [myFirstCondition, mySecondCondition], operator: query.Operator.OR });