[]
        
(Showing Draft Content)

Create a Direct Query Model

The procedure for creating a Direct Query Model for a dashboard is typically composed of four steps -

  1. Select the model type.

  2. Specify the data source.

  3. Configure data source connection details. And,

  4. Select the desired tables and views.

In Wyn Enterprise, you can create a Direct Query Model by manually filling in the configuration details in the designer or by re-using an existing data source available on the server. This article describes the detailed steps to create a Direct Query Model using both these methods.

To Create a Direct Query Model Using an Embedded Data Source

An embedded data source is defined in the Direct Query Model itself and is used only by that model. Use the below steps to create a Direct Query Model with an embedded data source.

  1. On the Resource Portal, navigate to the Create tab and then select Prepare Data under the Dashboard section.


    Create a Direct Query Model

  2. To create a new Direct Query Model, click the Create button.


    Create Direct Query Model

  3. In the Create Data Model window that appears, set the Data Source Type to Embedded Data Source.


    Set the Data Source Type for Direct Query Model

  4. Select the Data Provider you want to use for the Direct Query Model. The supported data providers are Oracle, SQL Server, MySQL, Postgres, MariaDB, IBM DB2, and BigQuery.


    Select Data Provider for Direct Query Model

  5. Based on the chosen data provider, the configuration details for the data source can vary. Let's say, you chose the SQL Server provider as shown below.

    You can connect to the data source by either entering the configuration details in the respective fields or directly through the connection string.


    Enter data source configuration details

  6. To verify the data source connection, use the Test Connection button, and then click the Next button to proceed further.

  7. Select the tables and views you want to include in the Direct Query Model. You can choose to display tables or views in the list by clicking the Tables or Views button, respectively. You can use the following options as well -

    • Include current relations - This option is used to include or exclude the existing relations in the selected tables and views.

    • Include related tables - This option is used to include or exclude the related tables in the selected tables and views. It is disabled in case you have not included current relations in the selected tables and views.

    Select tables and views

  8. Now, click the Done button.

    Based on the defined settings, a Direct Query Model is created as shown below.


    Direct Query Model Designer

To Create a Direct Query Model Using a Shared Data Source

A shared data source is one that already exists on the portal and can be reused to create different Direct Query Models. It is best suitable in scenarios where you want to use an existing data source that takes advantage of the data-pulling capabilities provided by a data model.

  1. On the Resource Portal, navigate to the Create tab and then select Prepare Data for the dashboard.


    Create a Direct Query Model

  2. Click the Create button to create a Direct Query Model for the dashboard.


    Create Direct Query Model

  3. In the Create Data Model window that appears, set the Data Source Type to Shared Data Source.


    Use shared data source for direct query model

  4. From the Data Source dropdown, select a Datasource you wish to use for the Direct Query Model. The Data Source dropdown lists the data sources that are available on the server and supports Direct Query Models including the following:

    Shared Data Source

    Note: The data source list displays the data sources with sufficient permissions only, i.e. Execute/Create, Read/Write, and Full Control.

  5. Click the Next button to proceed further.

  6. Select the tables and views you want to include in the Direct Query Model. You can limit the currently displayed tables or views in the list by clicking the Tables or Views button, respectively.


    Select tables and views

  7. Uncheck the Include current relations option to exclude the existing relations in the selected tables and views. You can uncheck the Include related tables option to exclude the related tables in the selected tables and views.

  8. Now, click the Done button.

    Based on the defined settings, a Direct Query Model is created as shown below.


    The Data Model Designer displays the mapped name of entities and attributes if the chosen data source uses table/column mapping.


    Data Model Designer

To Save Direct Query Model

  1. Click the Save button to use the Direct Query Model for binding data in dashboards.


    Save Direct Query Model

  2. In the Save As dialog box, enter the Direct Query Model name and comment (if any) as shown.


    Save As Dialog box

  3. Then, click the Save button.

    The saved direct query model will appear in the Data Model tab of Document Types.


    View saved direct query model on the Resource Portal