Simple dashboard from a CSV file
Note
In this tutorial all objects will be created and stored in a workbook. If using legacy folder navigation, create an individual directory to work in.
Create a directory
- Go to the DataLens home page
. - In the left-hand panel, select
All objects or Personal directory. - In the top-right corner, click Create → Directory.
- Enter a name for the directory.
- Click Create.
This guide demonstrates how to use DataLens to analyze dependencies, for example:
- Superhero's weight depending on gender.
- Superhero's weight depending on whether they are good or bad.
For source data, we are going to use the SuperHeroes.csv
file with data about the superheroes: name, gender, race, comics publisher, etc. Download
To visualize and explore data, set up DataLens and follow the steps below:
- Create a workbook.
- Create a connection.
- Create a dataset.
- Create the first chart.
- Create the second chart.
- Create a dashboard and add charts to it.
- Add selectors to the dashboard.
- Start analyzing superhero dependencies and data.
Getting started
To get started with DataLens:
- Log in
to your Yandex account. If you do not have an account, create one. - Open the DataLens home page
. - Click Open DataLens.
- Confirm that you have read the Terms of use
and click Log in.
-
Log in
to your Yandex account. -
Open the DataLens home page
. -
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 DataLens.
Note
To activate a DataLens instance, the user must have the
admin
orowner
role. For more information about roles, see Access management in Yandex Cloud Organization. -
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 any technical questions about the service, contact Yandex Cloud support
Create a workbook
- Go to the DataLens home page
. - In the left-hand panel, select
Collections and workbooks. - In the top-right corner, click Create → Create workbook.
- Enter a name for the workbook:
Tutorials
. - Click Create.
Create a connection
Create a connection to the source data file.
-
In the top-right corner of the workbook, click Create →
Connection. -
Under Files and services, select the Files connection.
-
Click Upload files.
-
Select the SuperHeroes.csv file. Wait until the table content appears on the screen.
-
Click Create connection.
-
Enter
SuperHeroes
for the connection name and click Create.
Create a dataset
Create a dataset based on the SuperHeroes
connection:
-
In the top-right corner of the connection page, click Create dataset.
-
Go to the Fields tab.
-
Create a field for the superheros's average weight:
-
Duplicate the
Weight
field: on the right side of the row with the field, click and select Duplicate. -
Rename the
Weight (1)
duplicate field asWeight avg
: click the field name, delete the current name, and enter the new one. -
In the Aggregation column, select Average. The aggregation field will change its color to blue: it is now a measure.
-
-
Save the dataset:
- In the top-right corner, click Save.
- Enter
SuperHeroes dataset
for the dataset name and click Create.
Create the first chart
To visualize data by gender, create a bar chart.
-
Click Create chart in the top-right corner of the dataset page.
-
Add superhero names to the chart. To do this, drag the
Name
field from Dimensions to the X section. -
Add superhero weights to the chart. To do this, drag the
Weight avg
field from Measures to the Y section. -
Sort columns by descending weight. To do this, drag the
Weight avg
field from Measures to the Sorting section. -
Color code superheros in the chart based on gender. To do this, drag the
Gender
field from Dimensions to the Colors section. -
Redefine the colors for the
Gender
dimension:-
Click
in the Colors section (the icon is displayed when you hover over the section). -
Select colors: Pink for Female; blue for Male; orange for unknown.
-
Click Apply.
-
-
Leave on the chart only those superheroes whose weight is known (greater than zero):
- Drag the
Weight avg
field from Measures to the Filters section. - In the window that opens, specify the Greater than operator and the 0value.
- Click Apply filter.
- Drag the
-
Save the chart:
- In the top-right corner, click Save.
- In the window that opens, enter
SuperHeroes — gender
for chart name and click Save.
Create the second chart
To visualize superheros as good or bad, create the second chart – a bar chart.
-
Copy the chart you created in the previous step:
-
In the top-right corner, click
→ Save as copy. -
In the window that opens, enter the
SuperHeroes — alignment
name for the new chart and click Save.
-
-
Replace the gender color code with the good-bad color code. To do this, drag the
Alignment
field from Dimensions to the Colors section and hold it over theGender
field until the latter turns red. -
Redefine the colors for the
Alignment
dimension:- Click
in the Colors section (the icon is displayed when you hover over the section). - Select the colors: green for good; blue for neutral; red for bad; orange for unknown.
- Click
-
Save your chart: click Save in the top-right corner.
Create a dashboard and add charts to it
Create a dashboard to add charts and other widgets to:
-
In the left-hand panel, select
Collections and workbooks and go to theTutorials
workbook. -
In the top-right corner, click Create →
Dashboard. -
In the panel at the bottom of the page, select Chart.
-
In the window that opens, click Select.
-
Choose the
SuperHeroes — gender
chart. -
Click Add.
-
Repeat steps 3-6 to add the
SuperHeroes — alignment
chart. -
Adjust the size of the charts with your mouse and place them on the dashboard as you prefer.
Add selectors to the dashboard
Add selectors to filter superheroes by race (Race
field) and publisher (Publisher
field).
-
In the panel at the bottom of the page, choose Selector.
-
Add a selector for race:
- Select
SuperHeroes dataset
. - Select the
Race
field. - Enable Multiple choice.
- Click Save.
- Select
-
Add a selector for publisher:
- Make sure you selected the
SuperHeroes dataset
dataset. - Select the
Publisher
field. - Enable Multiple choice.
- Click Save.
- Make sure you selected the
-
Position the selectors on the dashboard however you like.
-
Save the dashboard:
- In the top-right corner of the dashboard, click Save.
- Enter
SuperHeroes dashboard
for the dashboard name and click Create.
-
Your dashboard is ready.
Analyze data about superheroes
-
Apply various filters and analyze the weight dependencies on a superhero's gender and good or bad alignment.
The dataset analyzed shows the following dependencies:
- Men are generally heavier than women.
- Bad superheroes are mostly heavier than good ones.
-
You can create new measures in the dataset, e.g., average height (
Height
field average) and number of superheroes (number of unique entries from theName
field), and answer the following questions:- Which race is the most numerous?
- Is there a dependency between a superhero's height and their being good or bad?
- Which studio created the most superheroes?