Combining DataLens data

DataLens uses a connection to retrieve data from a source. You can create datasets, charts, and selectors from the connection's data. If the source has multiple tables, you can join them to build the required set of data. You can link data from different datasets at the chart level or through selector links.

Methods of combining data

You can use different methods to combine data:

At the dataset level

To join data at the dataset level, you can add tables to the workspace or write an SQL query.

Warning

You cannot join data from different sources at a single dataset level.

Adding tables

You can join data through the dataset creation interface by dragging tables to the workspace and configuring links between them using the JOIN operator.

SQL query

In a dataset, you can add an ad-hoc SQL query to the data source. When a data source is accessed, the query code is run as a subquery. You can use the output of the query as final dataset data or combine it with other source tables via the interface.

At the chart level

To combine data at the chart level, you can use a QL chart.

At the selector link level

You can add a selector to a dashboard to modify query output in its associated widgets:

  • On the dashboard, selectors and charts built from a single dataset link automatically.
  • Selectors and charts built from different datasets can be linked manually using aliases.

Before creating a link, make sure that the field used by the selector as a filter is included in the dataset the chart is built from. Otherwise, the link will not work. For more information, see the instructions Creating an alias.