Data Serialization Functions for SQL and SOQL

SQL and SOQL serialization functions convert the data into the form expected by the query in which the interaction is inserted.

Returns a grouping as a string in a SQL or SOQL query. Can also return multiple groupings.

The input data must be a scalar or a one-dimensional array of groupings. Null or no results returns an ungrouped query.

ArgumentDescription
SQLType(Required) Specify SQL or SOQL variant. Valid values are dataset, snowflake, and sobject.
includeKeywords(Optional) The default value is false.

For SOQL, use sobject.

Let's look at some examples where the selection detemines the groupings in a SQL or SOQL-form query. These examples are based on the stepFoo source query. Assume that stepFoo.selection retrieves these rows from the query.

Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


To make the interaction return multiple fields for the grouping, replace the cell interaction function with a column function and update the arguments.

Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:

Returns the grouped results for a SQL or SOQL query restricted by a conditional filter logic applied on aggregate functions. This function is similar to the asSQLWHERE function.

ArgumentDescription
SQLType(Required) Specify SQL or SOQL variant. Valid values are dataset, snowflake, and sobject.
includeKeywords(Optional) The default value is false.

For SOQL, use sobject.

These examples are based on the stepFoo source query.

The < and >=<= operators aren't supported.

Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Output in SOQL:


Function:

Output in standard, Snowflake live dataset, or SOQL:

Returns the sort order as a string for a SQL or SOQL query.

The input data must be scalar, one-dimensional, or a two-dimensional array. A two-dimensional array is treated as a tuple of interactions.

ArgumentDescription
SQLType(Required) Specify SQL or SOQL variant. Valid values are dataset, snowflake, and sobject.
includeKeywords(Optional) The default value is false.

For SOQL, use sobject.

These examples are based on the stepFoo source query. Assume that stepFoo.selection retrieves these rows from the query.

Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:

Returns the SQL or SOQL expression and alias as a string that you can use to project a field in the query. The query expression determines the value of the field. The alias is the field label.

ArgumentDescription
SQLType(Required) Specify SQL or SOQL variant. Valid values are dataset, snowflake, and sobject.

For SOQL, use sobject.

These examples are based on the stepFoo source query. Assume that stepFoo.selection retrieves these rows from the query.

Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:

Returns the SQL or SOQL query results restricted by a conditional filter logic applied on a measure, dimension, or date.

ArgumentDescription
SQLType(Required) Specify SQL or SOQL variant. Valid values are dataset, snowflake, and sobject.
includeKeywords(Optional) The default is false.

For SOQL, use sobject.

These examples are based on the stepFoo source query.

Function:

Output in standard dataset, Snowflake live dataset, or SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Multiple Filters

Function:

Output in standard or Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard dataset:

Function:

Output in Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard dataset:

Function:

Output in Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in standard dataset:

Function:

Output in Snowflake live dataset:

Function:

Output in SOQL:


Function:

Output in Snowflake live dataset:

Function:

Output in SOQL: