All Products
Search
Document Center

Manage datasets

Last Updated: Jul 27, 2020

A dataset is a collection of data in the form of a two-dimensional table. It is generated by executing an SQL statement to query a database. This topic describes how to use datasets.

Create a dataset

  1. Log on to the DMS console.

  2. In the top navigation bar, choose Data Factory > Data Visualization.

    For more information about how to access the data visualization feature, see Access the data visualization feature.

  3. In the left-side navigation pane, click Dataset. On the Dataset management page, click 1.

  4. In the Write SQL step, set relevant parameters and click Execute. The following table describes the parameters.

    Parameter Description
    Name (Required) The name of the dataset. The dataset name must be unique for each DMS user.
    Description (Optional) The description of the dataset.
    Select an existing database (Required) The database to be queried. You must have the permission to query the database.
    SQL query statement (Required) The SELECT statement for querying data. You can enter any SQL query statement that can be executed successfully. To filter data in a subsequent chart, reference a variable in the format of $Variable name$ in the SQL query statement.
    Variable (Optional) The variable for filtering data. In a dashboard where you have configured a filter, you can filter data by dynamically modifying the value of the variable referenced by the SQL statement in the dataset.
    If a referenced variable is of the STRING type, you need to enclose the variable name in single quotation marks (‘ ‘) in the SQL statement, for example, name='$var1$'.

    Data Visualization-datasets1

  5. Wait until the SQL statement is successfully executed and click Next Step to go to the Edit dataset model step.

  6. Set Data type and Visualization type. The following table describes the parameters.

    When you configure a dataset model, you need to specify each queried field as a dimension or measure, and also specify a visualization type for each field. For more information about dimension and measure, see Terms.

    Parameter Value Usage
    Data type
    • Dimension
    • Measure
      To show how transaction volume changes over time, you can specify the time field as a dimension and the transaction volume field as a measure.
      Visualization type
      • Digital
      • String
      • Date
      • Region: Country
      • Region: Province
      • Region: City
      To show how transaction volume changes over time, you can set the data type of the time field to DATE and that of the transaction volume field to NUMERIC.
    • Click Save to return to the Dataset management page. You can find the dataset that you just created in the dataset list.

      You can also click Configuration chart to go to the page for creating a chart. By default, the chart will be created based on the newly created dataset.

    Modify a dataset

    1. Log on to the DMS console.

    2. In the top navigation bar, choose Data Factory > Data Visualization.

      For more information about how to access the data visualization feature, see Access the data visualization feature.

    3. On the Dataset management page, find the target dataset in the dataset list and click 1-3 in the Operation column. On the page that appears, you can modify the configurations of the dataset. For more information about how to write SQL statements and edit dataset models, see Create a dataset.
      Data Visualization-datasets2

    Delete a dataset

    1. Log on to the DMS console.

    2. In the top navigation bar, choose Data Factory > Data Visualization.

      For more information about how to access the data visualization feature, see Access the data visualization feature.

    3. On the Dataset management page, find the target dataset in the dataset list and click 1-5 in the Operation column.
      Data Visualization-datasets3

      Note: Before a dataset is deleted, DMS checks whether the dataset is referenced by any chart. If the dataset is referenced, you need to cancel the reference or delete the chart that references the dataset before you delete the dataset.