Creating Datasets


For Data Federation and Static Data, you need to create datasets to define the range of data that you want to use in DTV.



Creating Datasets for Static Data

You can import a CSV file that contains your dataset to create a static dataset.


You can create a dataset for your static data source by following these steps:

  1. Locate your static data source from the table in the External Data Sources tab.

  2. Click Dataset dataset_icon.
    The Manage Datasets window appears.

  3. Click New Dataset to open the dataset creation dialog.


    ../../_images/manage_static_dataset.png


  4. In the Name box, specify the name of your new dataset.

  5. Click Upload to upload the CSV file containing your data.

  6. Click OK to create your dataset.



Creating Datasets for Data Federation

You can write an SQL query to define the set of data that you want to acquire from Data Federation.


You can create a dataset for Data Federation by following these steps:

  1. Locate your data source from the table in the External Data Sources tab.
  2. Click Dataset dataset_icon.
    The Manage Datasets window appears.
  3. Click New Dataset to open the dataset creation dialog.
  4. In the Name box, specify the name of your new dataset.
  5. In the SQL box, write the SQL query that will retrieve your data.
  6. In the Custom Variable section, you can define custom variables for your SQL query.
    For more information on how to define and use custom variables, see the next sections.
  7. Click OK


../../_images/data_fed_dataset.png

Defining Custom Variables

You can pass self-defined variables to the SQL query specified for a Data Federation dataset. This enables you to perform similar queries without the need to create repeating datasets and SQL queries.


You can define custom variables by following these steps:

  1. Make sure you have specified a Data Federation data source and are currently creating a new dataset for the data source.
  2. At the New Dataset dialog window, click Add Variable.
    The New Variable dialog appears.
  3. In the Name box, specify a name for the variable.
  4. From the Type list, select the type of the variable.
    • If List is selected, specify the pre-defined values in the Value box, separating each value with a comma.
    • If Time is selected, select the format of the time value from the Format list.
  5. In the Default box, specify the default value of the variable.
  6. Click OK.


After defining the variables, you can use them in the SQL query with the syntax ${var_name}.


For example, if you have a variable called name, you can write the following SQL query:

SELECT *
FROM data_table
WHERE name = ${name};


Using Custom Variables

If a custom variable was used in an SQL query, its value can be specified in the following locations:


Location Description
Chart Editor Dashboard designers need to specify its value in the Data Fields section.
Global and Widget Filter Appears as a data field option, prefixed with [P]. This enables dashboard users to specify a value for the variable through the use of filters.



Previewing Datasets

For Data Federation and Static Data datasets, you can preview their data. Additionally, you can also download the data as a CSV file.


You can preview the data by following these steps:

  1. Locate the dataset you want to preview, click on Dataset dataset_icon to open Manage Dataset window.
  2. Click on Preview preview_dataset_icon.
  3. To download the data, click Download at the top of the Preview dialog.