In this article
Functions for aggregating values of "vector" (compound) expressions, like grids or numeric lists. Includes boolean, numeric and any types.
selected(x, c1, c2, ...) | The first argument is either a text/categorical scalar or a boolean vector (multi). Other arguments are text constants. | Boolean | A shortcut filter function that can be applied both to open/single/multi choice variables. In case of single/open scalar argument it is equivalent to IN(x, c1, c2, ...). In case of multi choice argument it is equivalent to ANY(FIELDMASK(x, c1, c2, ...)) |
| numeric(x) | Numeric or single variable with scores | Numeric | A uniform way to evaluate a numeric value for numeric/single variables. For a numeric argument numeric(x) = x For a single variable argument numeric(x) = score(x) |
| via(expression, table1:, table2:, ...) | The first argument is any expression, other arguments specify tables in data source. | Any | Evaluates an argument expression in the context where the specified list of anchor tables are used to resolve join path ambiguities. It is similar to"via" request actionapplied to a particular expression. This function can be used either in lists or in aggregated tables. |
| viashort(expression, table1:, table2:, ...) | The first argument is any expression, other arguments specify tables in data source. | Any | Similar to the above. Additionally shortest path preference strategy is activated in case anchor tables are not enough or cannot be used. In this case the list of table can be empty meaning that join paths are chosen by length only. This function can be used either in lists or in aggregated tables. |
| List(arg1, arg2,...) | Any | Vector | Constructs a compound value ("vector") from with fields defined by arguments. All arguments must be scalar values of compatible types. Field codes are automatically assigned to be sequential numbers ("1", "2", etc) |
| VList(var1, var2, ...) | Any variables | Vector | Similar to List function with the following differences: Arguments are expected to be scalar variable references (or fields of compound variables) with compatible typesResulting field codes are constructed from respective argument variable namesfor a plain variable argument the variable name is usedfor a compound variable field the resulting field name is <variable_name>_<field_name> |
| Base(exp, [table]) | The first argument is an aggregating expression, the second specifies a table. | Integer | Evaluates "base count" for the specified aggregating expression. Base is defined as number of records in the base table that "contribute" to the value of the aggregating expression specified. Base table is provided in the (optional) second argument, by default the table of the source expression argument is used. For example Base(Avg(survey:q1)) evaluates (in current aggregating context) the number of (unique) survey records contributing to Avg evaluation (e.g. where q1 is not null). Note that in case base table is at higher level than source table (e.g. is a parent of that one) then a record is considered "contributing" to the base if any of its child source records contribute to the original expression and each base record is counted once. Base is an aggregating function itself and is evaluated in current context as any other aggregating function. Currently base function recognizes the following aggregating functions as arguments: countsumavgstdevstdevpvarvarpstderrstderrpsomeeveryminmaxmodemedianIn other cases Base evaluates to null. |
| ifFiltered(table, ifTrue[, ifFalse]) | The first argument is a table, other arguments are any expressions | Type of the arguments | Evaluates one of the arguments depending on whether a filter is applied (directly or indirectly) to the specified table. If the table is filtered, returns ifTrue value, otherwise ifFalse value. ifFalse argument is optional, default value is null. |
| promoteFilter(sourceTable,targetTable) | Tables | Boolean | A shortcut to construct a filter for the target (parent) table when the source (child) table is filtered. Equivalent to IfFiltered(sourceTable, SOME(sourceTable, targetTable), True) |