Conditions
Conditions help you filter dataset query results based on the criteria you set. 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.
You can create a condition using 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 you should only include it when the operator requires 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 });