Concepts → Incorta Analyzer Table Formula Column

With the Analyzer, you can create an Incorta Analyzer Table for a physical schema. An Incorta Analyzer Table represents the materialized result of a Listing table or Aggregated table visualization. A load or an update of an Incorta Analyzer Table persists data to shared storage as Apache Parquet files.

Note

Prior to Release 5.1.2, an Incorta Analyzer table persisted to shared storage as Direct Data Mapping (DDM) files, but not Apache Parquet files.

You add a formula column to an Incorta Analyzer Table in the Analyzer when creating the table. It is not possible to add a formula column to an Incorta Analyzer Table using the Table Editor.

Properties of a formula column in an Incorta Analyzer Table

After creating a formula column using Formula Builder, in the Analyzer, the following properties are available in the Table Editor:

PropertyControlDescriptionConfiguration
Show in AnalyzercheckboxSelect if the column is displayed in the Analyzer toolSelect or deselect checkbox
Nameread onlyThe column’s name; used in the fully qualified name of the column.Valid characters: A-Z, a-z, 0-9, $, _
Name must begin with a letter character
Labelread onlyA user-friendly name. See NOTE below on editing Label.utf-8 md valid characters, including emoji 😀
Typeread onlyThe Incorta Data Type of the column. See below section on type casting.Integer, Double, Long, String, Date, Timestamp, Text, and Null
Functiondrop down listSelect the Incorta Function of the columnDimension, Measure, or Key.
An Incorta Analyzer table could not have a key column before 5.2.11. However, starting with 5.2.11, you can specify key columns in Analyzer tables
Encryptdrop down listSelect if the column is encrypted in shared storage.False
Incorta Analyzer tables do not support encrypted columns. You cannot set this property; it is always false.
Important: Key columns in Analyzer Tables

In releases before 5.2.11, an Incorta Analyzer table would not allow the function of an Incorta Analyzer table column or Incorta Analyzer table formula column to be a key. However, starting with 5.2.11, you can specify key columns for Incorta Analyzer and SQL tables. Adding, removing, or changing key columns does not require running a load job as derived tables are refreshed as part of schema update jobs. The derived table’s unique index is calculated and saved as a snapshot DDM file each time the key columns are updated or the schema or table is loaded.

Make sure that the column or columns that you designate as key maintain row uniqueness because no deduplication is performed for derived tables. If the selected key columns result in duplicate key values, the Engine returns the first matching value whenever a single value of the key columns is required.

Important

The encryption property for an Incorta Analytics table column is always set to false. In previous releases, you can set it to either true or false.

Label and Name Properties

The name property is only editable in the Analyzer. The default name is New Formula. You can return to the Analyzer to edit the column name. While in the Analyzer, double click the name of the formula column pill to edit the name. The label for the column will be automatically assigned the same as the column name.

Incorta Function Property: Measure and Dimension

Formula columns can be assigned as measures in a Listing Table visualization.

Formula columns can be assigned as grouping dimensions and measures for Aggregated Table visualizations.

Formula Column type casting

Incorta will assign the Incorta Data Type of a formula column based on the output data of the formula. If you need to change the Incorta Data Type of the column you will need to convert the type using casting. You can cast the output of a formula using built-in conversion functions, such as int(), in the Formula Builder.

Supported built-in functions

The Formula Builder supports the following built-in functions for an Incorta Analyzer Table formula column:

Function TypeDescriptionExample
AggregationFunctions that accumulate data to a summary valueaverage, count, distinct, max, median, min, or sum
BooleanFunctions that evaluate to True or Falseand, between, contains, endsWith, in, inList, isNan, isNull, like, not, or, startsWith
Conditional StatementStatements that return a value based on the evaluation of a parametercase, decode, and if
ConversionFunctions that convert the Incorta Data Type of a parameter. In addition, functions that manipulate Timestamp and Date values for different return values.day, double, monthName, parseDouble, string, toChar, and year
FilterFunctions that specify a subset of data itemsfirstVersion or lastVersion
MiscellaneousFunctions with assorted usesdescendantOf, lookup, rowNumber, and schemaRefreshTime
ArithmeticFunctions that take one or more values and return a single valueabs, ceil, exp, floor, max, min, mod, rnd, round, sqrt, and trunc
DateFunctions that manipulate Timestamp and Date valuesaddDays, date, month, removeTime, weekday, and year
StringFunctions that return string values or return values based on string parametersbin, concat, find, ifNull, repeat, rTrim, and upper
AnalyticFunctions that compute values over a group of rows and returns a single result for each rowdenseRank, index, or rank

Incorta Analyzer table formula column references

A formula expression returns a scalar value or array of values. These values are of a specific type. A formula expression can consist of builtin-functions, variables, and referenced columns.

Formula columns have some specific capabilities in regards to the kind of columns, schema, and views they can reference in their formula expressions.

Using the Analyzer tool, you create the formula expression for a formula column in the Formula Builder.

The following are the referencing capabilities of an Incorta Analyzer Table formula column:

Note

A data backed column references data that persists to shared storage.

Table or View TypeColumn TypeReferenceableNote
AliasData-backed columnYes
AliasFormula columnYes
Business Schema ViewData-backed columnYes
Business Schema ViewFormula columnYes
Incorta Analyzer TableData-backed columnNo
Incorta Analyzer TableFormula columnNo
Incorta SQL TableData-backed columnNoThe Incorta SQL Table is an Incorta Labs feature in this release.
Incorta Analyzer ViewData-backed columnNo
Incorta Analyzer ViewFormula columnNo
Materialized ViewData-backed columnYes
Materialized ViewFormula columnYes
Physical Schema TableData-backed columnYes
Physical Schema TableFormula columnYes

Variable references in formula expressions

In the Formula Builder, in the Functions and Variables panel, certain variables are referenceable in the formula expression. Some types of variables all users have access to and other kinds of variables are subject to Discretionary Access Control (DAC).

Here are the various categories of variables:

  • System variables: Predefined variables within Incorta that return a value as a defined type.
  • External session variables: Variables that query an external data source when invoked. Values returned as string.
  • Internal session variables: Variables that query data within a schema. Values returned as string.
  • Global Variables: A static variable available to all tenant users that return a value as a defined type.

Formula expressions in an Incorta Analyzer Table can reference the following variables:

Variable TypeReferenceableNote
System variableYesExcluding the $user variable
External session variableNoReferenceable in the Analyzer for the Incorta Analyzer Table. A table load will succeed. In the Analyzer for an Insight, the formula column will show as #ERROR.
Internal session variableNoReferenceable in the Analyzer for the Incorta Analyzer Table. A table load will succeed. In the Analyzer for an Insight, the formula column will show as #ERROR.
Global variableNo
Note

When using system variables in the physical schema, the system variable’s value is only calculated on a schema load. The value will not be calculated at runtime. Take this into account when using them in any aspect of your physical schema.

Additional Considerations

Aggregations

You can perform aggregations using an Incorta Analyzer table formula column, taking advantage of an aggregation function. Alternatively, you can also build the Incorta Analyzer table in the Analyzer as an Aggregated table.

Circular dependencies

A business schema view column can reference an Incorta Analyzer table. The same Incorta Analyzer table can reference the same business schema view column. These types of cyclical dependencies will cause errors and should be avoided.