Getting started with DataLens
In this tutorial, you'll create your first dataset, build several charts to visualize data, and place them on a dashboard.
To get started with DataLens:
-
Log in to your Yandex account.
-
Open the homepage DataLens.
-
Click Open Datalens.
-
Select one of the options:
-
If you already have an organization, select it from the drop-down menu in the Organizations tab and click Open DataLens.
Note
To activate a DataLens instance, the user must have the
admin
orowner
role. For more information about roles, see Granting permissions. -
If you have a cloud but no organization, click Add new DataLens. In the window that opens, enter your organization's name and description and click Create organization and DataLens. For more information about working with organizations, see Getting started with organizations.
-
If you have a technical question about the service, please contact support. To ask for advice or discuss the solution to your problem or best service practices, write to the DataLens chat in Telegram.
Create a connection
-
Go to the connections page.
-
Click Create connection.
-
Select the ClickHouse connection.
-
In the window that opens, specify the connection parameters:
- Connection type — Specify manually.
- Host name —
rc1a-ckg8nrosr2lim5iz.mdb.yandexcloud.net
. - HTTP interface port —
8443
(default). - Username —
samples_ro
. - Password —
MsgfcjEhJk
.
-
Enable the HTTPS option and Allow subqueries in datasets and queries from charts.
-
Check the connection and click Create connection.
-
Enter
Sample ClickHouse
as your connection name. -
Click Create.
-
Wait for the connection to be saved.
Create a dataset
-
In the upper-right corner, click Create dataset.
-
Drag the MS_SalesMiniTable table to the workspace.
-
Go to the Fields tab.
-
In the Aggregation column, select Sum for the Sales field.
-
Create a measure for the number of orders.
- Rename the OrderID field to OrderCount.
- Change the aggregation type to Number of unique.
-
For the ShopAddressCoord field, change the data type to Geopoint.
-
Click Save in the upper-right corner to save the dataset.
-
Enter the dataset name and click Create.
Create a column chart
-
In the upper-right corner, click Create chart.
-
For the visualization type, choose Column chart.
-
Add the product subcategory to the chart. To do this, drag the ProductSubcategory field from the Dimensions section to the X section.
-
Add a sales measure to the chart. To do this, drag the Sales field from the Measures section to the Y section.
-
Sort the chart in descending order of sales measure. Drag the Sales field from the Measures section to the Sorting section.
-
Save the chart.
- In the upper-right corner, click Save.
- In the window that opens, enter the Sales by subcategory name for the chart and click Save.
Create an area chart
-
In the created chart, select Area chart as the visualization type.
-
Replace the product subcategories with the order date on the X-axis. From the Dimensions section, drag the OrderDate field to the X section and hold it over the ProductSubcategory field until it turns red.
-
Add the product category to the chart. To do this, drag the ProductCategory field from the Dimensions section to the Colors section.
-
Display the chart by week.
- Click the calendar icon next to the OrderDate field in the X section.
- In the drop-down list of grouping options, select Week under Grouping.
- Click Apply.
-
Save the chart.
-
Click the down arrow next to the Save button in the upper-right corner.
-
Choose Save as.
-
In the window that opens, enter the Sales by week name for the new chart and click Save.
-
Create a map
-
In the created chart, select Map as the visualization type.
-
Add the coordinates of the points of sale to the map. To do this, drag the ShopAddressCoord field from the Dimensions section to the Points (Geopoints) section.
-
Change the point size based on the number of orders. To do this, drag the OrderCount field from the Measures section to the Points size section.
-
Change the point color based on the sales measure. To do this, drag the Sales field from the Measures section to the Colors section.
-
Add the following fields to the Tooltips section:
- ShopAddress
- ShopName
- Sales
- OrderCount
-
Save the chart.
-
Click the down arrow next to the Save button in the upper-right corner.
-
Choose Save as.
-
In the window that opens, enter the Sales map name for the new chart and click Save.
-
Create a dashboard
- Go to the DataLens homepage.
- Click Create dashboard.
- Enter a name for the dashboard and click Create.
Add charts to the dashboard
-
In the upper-right corner, click Add and choose Chart.
-
In the window that opens, click Select.
-
Select the Sales map chart. This will automatically fill in the Title field.
-
Click Add.
-
Repeat the steps to add the Sales by subcategory and the Sales by week charts.
-
Position the charts on the dashboard however you like.
Add a selector to the dashboard
-
Click Add and choose Selector.
-
Add the calendar selector for the order date.
- Select the created dataset.
- Select the OrderDate field.
- This will automatically fill in the Title field. Click the Show checkbox next to the selector title.
- Select the Calendar type.
- Enable Range.
- Click Add.
-
Position the selector on the dashboard wherever you like.
-
Save the dashboard. To do this, click Save in the upper-right corner.
What's next
- Review the tutorials for examples of using the service.
- Read about service concepts.
- See step-by-step instructions.
- Look at an example ready-made dashboard.