All Products
Search
Document Center

Procedure

Last Updated: May 23, 2019

Step 1: Buy the DataV Basic Edition

Log on to the DataV console. In this tutorial, you can connect to DLA in MySQL-compatible mode. Therefore, the DataV Basic Edition meets service needs.

Step 2: Add the DLA data source

  1. Before you add a data source, configure the DLA whitelist to enable access to DLA from DataV.

    For more information about DataV whitelists, see Database whitelist settings.

  2. Log on to the DataV console. Click the Data Sources tab. On the tab page that appears, click Add Source.

    1

  3. In the Add Source dialog box that appears, enter the DLA data source information.

    2

    • Type: the type of the data source for DLA. Select MySQL Compatible Database.

    • Name: the data source name that is displayed in the system. Enter any name.

    • Host: the public address (classic network address) that is used to connect to DLA. For more information about how to obtain this address, see Create an endpoint.

    • Username: the name of the service account for DLA access.

    • Password: the password of the service account for DLA access.

    • Port: the port number that is used to connect to DLA. Set it to 10000.

    • Database: the database that DLA uses. Enter the DLA schema name, which is tpch in this example.

  4. Click OK. The system automatically tests the connectivity to the database. After the data source is added, the new data source is displayed in the data source list.

    3

Step 3: Create a visual application

  1. Log on to the DataV console.

  2. Click the Projects tab. On the tab page that appears, click Create Project.

    4

  3. Select E-Commerce Platform Real-time Business and click Create.

    5

  4. Enter a dashboard name in Project Name, and click Create.

Step 4: Modify the dashboard layout

  1. In this example, the dashboard will display the sales data in each country. Therefore, you need to delete widgets in the red boxes.

    6

    The following figure shows the dashboard after you delete the widgets and adjust the layout.

    7

  2. Assume that sales data in different countries needs to be displayed on a world map. Delete the original map of China, click the Maps icon in the toolbar, and then select Flat Map with 3D Effects.

    8

  3. Change the name of Sales Ranking by Province to Sales Ranking by Country.

    9

Step 5: Configure the data for the map widget on the dashboard

  1. Select the 3D Globe widget that you added in step 4 and configure parameters on the Data tab page.

    • Type: the type of data source that is used. Select Database.

    • Data Source: the database that is used. Select the DLA data source (dla_hangzhou_tpch) that you added in step 2.

    • SQL: the SQL statement that is used to sort sales records in different countries in descending order. Enter the following statement.

      1. select sum(o_totalprice) total_price, n_nationkey, n_name, n_id
      2. from orders
      3. join customer on o_custkey = c_custkey
      4. join nation on c_nationkey = n_nationkey
      5. group by n_nationkey, n_name, n_id
      6. order by total_price desc;
    • Field ID and value: the values of the n_id and total_price columns that are returned by the preceding SQL statement.

    • Set Auto Data Request for business data on the dashboard based on your needs, for example, Every 60 Second.

      10

  2. After you configure the preceding parameters, click Refresh Data.

Step 6: Configure data for the total sales widget on the dashboard

  1. Select the Total Sales widget, and then configure the parameters on the Data tab page.

    • Type: the type of data source that is used. Select Database.

    • Data Source: the database that is used. Select the DLA data source (dla_hangzhou_tpch) that you added in step 2.

    • SQL: the statement that is used to query the total sales volume. Enter the following statement.

      1. select sum(o_totalprice) total_price
      2. from orders;
    • value: the value of the total_price column that is returned by the preceding SQL statement.

    • Set Auto Data Request for business data on the dashboard based on your needs, for example, Every 60 Second.

      11

  2. After you configure the preceding parameters, click Refresh Data.

Step 7: Configure data for the sales ranking by country widget on the dashboard

  1. Select the Sales Ranking by Country widget and configure parameters on the Data tab page.

    • Type: the type of data source that is used. Select Database.

    • Data Source: the database that is used. Select the DLA data source (dla_hangzhou_tpch) that you added in step 2.

    • SQL: the SQL statement that is used to sort sales records in different countries in descending order. Enter the following statement.

      1. select sum(o_totalprice) total_price, n_nationkey, n_name
      2. from orders
      3. join customer on o_custkey = c_custkey
      4. join nation on c_nationkey = n_nationkey
      5. group by n_nationkey, n_name
      6. order by total_price desc;
    • value and content: the values of the total_price and n_name columns that are returned by the preceding SQL statement.

    • Set Auto Data Request for business data on the dashboard based on your needs, for example, Every 60 Second.

      12

  2. After you configure the preceding parameters, click View Response Result.

Step 8: Preview and publish the dashboard

  1. Click Preview in the upper-right corner to preview the dashboard after it is published.

    13

    The preview is shown in the following figure.

    14

  2. After you confirm that the dashboard layout is correct, click Publish in the upper-right corner. Click the share link to copy the URL, and paste it in the address box of your browser to view the dashboard.

    16

    17