Data model in DataLens

Data in a dataset is represented as fields.

Data source

One or more tables are used as the data source.


There is a limit on displaying the first 1,000 tables from a source in a dataset. If the required tables are not on the list, currently, you can only add them manually using an SQL query.

If there are multiple tables in the source, you can join them with a JOIN.
When the tables are joined, a link is created between them. When you create a link, you specify the fields from the source table and merged table.

Tables are linked automatically by the first match in the field name and field data type.

In this case, you can:

  • Edit fields in the link.
  • Add new links or delete existing links.
  • Change the type of a JOIN (INNER, LEFT, RIGHT, or FULL) in the link.

A JOIN is used if a query made from a chart accesses fields of two or more dataset tables.

A JOIN is not used if:

  • The dataset contains one table.
  • The dataset contains multiple tables, but the query accesses the fields of only one of those tables.

Data fields

The fields define the structure and format of the dataset. The following types of fields are available:

  • Dimension. Contains values that define data characteristics, such as city, date of purchase, or product category. The aggregation function is not applied to fields with a dimension, otherwise the field becomes an measure. In the interface, dimensions are displayed in green.
  • Measure. Contains numeric values that aggregation functions (information) are applied to. such as the amount of clicks and the number of click-throughs. If you remove the aggregation function from this field, it becomes a dimension. In the interface, measures are displayed in blue.

In the dataset creation interface and wizard, you can duplicate fields, create fields, and use aggregation functions.


The maximum number of fields in a single dataset is 1200.

DataLens lets you create calculated fields using formulas.
To write formulas, you can use existing dataset fields, constants, and functions.
For a full list of functions, see the Function reference.

To learn more about calculated fields, see Calculated fields.

Data aggregation

The following aggregation functions are available for fields with different data types:

FunctionDescriptionSupported types
NoWithout aggregationAll types
AverageArithmetic mean valueFractional number
AmountNumber of recordsString
Date and time
Fractional number
Number of uniqueNumber of unique recordsString
Date and time
Fractional number
MaximumMaximum valueDate
Date and time
Fractional number
MinimumMinimum valueDate
Date and time
Fractional number
AmountSum of valuesFractional number

Additional aggregation functions are available in calculated fields.


You cannot use aggregation functions for some sources.
The sources you can use aggregation functions for are listed in Data source support section on the aggregation function page in the reference.

To learn more about data types, see DataLens data types.

See also