In this article
Control end user access to Studio dashboards by controlling data access and page/widget visibility. Data expressions and type conversions are supported.
Data Types
Data types in Data Engine can be either scalar (representing primitive values) or "vector" (representing an associative arrays of scalar values). Some variable types (such as grids) produce vector values. It is also possible to construct vector values from individual scalar values.
The following data types are supported in Data Engine expression model.
| Type | Description | Vector support |
|---|---|---|
Null | Type of null value representing a missing value | - |
Boolean | Represents a boolean value | + |
Integer | Represents an integer number | + |
Real | Represents a floating-point number | + |
Text | Represents a string value | + |
Date/time | Represents a data/time value | + |
Category | Represents a single choice in a categorical variable | + |
| Geolocation | Represents a geographical point defined by latitude and longitude values | - |
The list of types is most likely to be extended with "vector" types later.
Type Conversions
Values of supported types can be converted from one type to another either implicitly or explicitly. For example one expression could contain variables, constants or functions of different types, and they may need to be converted to a common type so that the expression can be evaluated.
Implicit means that one type is converted to another automatically.
Explicit means that a special instruction must be written in the expression to perform the conversion.
Possible conversions are summarized below.
| From | |||||||||
|---|---|---|---|---|---|---|---|---|---|
Null | Boolean | Integer | Real | Text | Date/Time | Category | Geolocation | ||
To | Boolean | ++ | ++ | - | - | - | - | - | - |
Integer | ++ | - | ++ | + | - | - | - | - | |
Real | ++ | - | ++ | ++ | - | - | - | - | |
Text | ++ | + | + | + | ++ | + | + | + | |
Date/Time | ++ | - | - | - | - | ++ | - | - | |
Category | ++ | - | - | - | ++ | - | ++ | - | |
| Geolocation | ++ | - | - | - | + | - | - | ++ | |
In this table:
- - No conversion
+ - Explicit conversion
++ - Implicit conversion
Expression Elements
Data Engine expressions are built from the following atomic elements:
Constants. It is possible to define constants of all supported types except category.
Variable references
Operators (unary and binary)
Function calls
In some function the following special elements are required:
Type reference (for value conversion)
Level references
Hierarchy references (for rollup aggregations). A hierarchy is always associated with some level.
Recoding definitions (for Recode function)
Data Expressions
A Data expression is a function that can be used to retrieve or calculate data from the hub source.
Data can be fetched directly, for example:
value: survey:comment
or it can be constructed or calculated, for example:
// concatenating several string values value: contact:FirstName + " " + contact:LastName // calculating average from LTR question aggregations (or any calculations) // can only be performed on categorical questions that have a score // or numerical questions. So we first need to apply score() function value: average(score(survey:LTR)) // calculating average on filtered question // add up values from AnnualRevenue column in revenue table where revenue:year value equals 2019 value: sum(revenue:AnnualRevenue, revenue:year=2019) // number of completed responses value: COUNT(survey:response,survey:status='complete')
Sorting Criteria
Sorting criteria are used in ranking functions. A criterion consists of the following items:
An Expression defining the value to sort by (must be of comparable type).
The sorting direction (ascending/descending).