[]
        
(Showing Draft Content)

Create a Data Model

The procedure for creating a data model for a report is typically composed of three steps - select the model type, configure data source connection details, and select the desired tables and views.


In Wyn Enterprise, you can create a data model by manually filling in the configuration details in the designer or by re-using an existing data source available on the server. The supported data source types are Oracle, SQL Server, MySQL, and PostgreSQL. This article describes the detailed steps to create a data model using both these methods.

To Create a Data Model Using an Embedded Data Source

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

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

    Create a Data Model

  2. To create a new data model, click the Create button.

    Create a Data Model for report

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

    Creating Data Model using Embedded Data Source

  4. Select the Data Provider you want to use for the data model. The supported data providers are Oracle, SQL Server, MySQL, and PostgreSQL.

    Select Data Provider for Data 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.

    Enter data source configuration details

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

    Please note that for SQL Server data source, you can add the option recompile=true in the query while creating the data model using the advanced connection string.

  6. Creating semantic model using embedded data source11


    The recompile option can make the query run faster.

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

  8. Select the tables and views you want to include in the data model. You can use the following options also -

    • Find additional relations - This option is used to include or exclude the additional relations for which there are no foreign key relationships in the database schema. If you uncheck this option, a data model with predefined relationships is created with no additional relationships.

    • Select or clear all items - This option is used to select all the items in the list, or clear the chosen items in the list.

    Select tables and views

  9. Now, click the Done button.

    Based on the defined settings, a data model is created as shown below.

    Data Model Designer for report

To Create a Data Model Using a Shared Data Source

A shared data source is a data source that already exists on the portal. It is best suitable in scenarios where you want to use the same data source to create different data models.

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

    Create a Data Model

  2. To create a new data model, click the Create button.

    Create a Data Model for report

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

    Creating Data Model Using a Shared Data Source

  4. Enter the name for the data model in Model Name.

    Data Model Name

  5. Select the Data Source you want to use for the data model. The list displays the existing data sources available on the server supported by data models - Oracle, SQL Server, MySQL, and PostgreSQL.

    Choose shared data source for data model

    Note: The list displays only those data sources on which you have sufficient permissions i.e. Execute/Create, Read/Write, and Full Control.

    You can select the SQL Server Data Source having the recompile option to create a semantic model. The recompile option can make the query run faster. For this, you need to add the option recompile=true in the query while creating the Data Source using the advanced connection string as shown below.

    creating recompile datasource

    For details refer to the topic Recompile Option.

  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 data model. You can use the following options also -

    • Find additional relations - This option is used to include or exclude the additional relations for which there are no foreign key relationships in the database schema. If you uncheck this option, a data model with predefined relationships is created with no additional relationships.

    • Select or clear all items - This option is used to select all the items in the list, or clear the chosen items in the list.

    Select tables and views

  8. Now, click the Done button.

    Based on the defined settings, a data model is created as shown below.

    Viewing Data Model in the Designer

To Edit, Validate, and Save a Data Model

  1. Edit your data model, by adding new entities, attributes, relations or updating the existing ones.

    Note: If the data source referenced by the data model is no longer available on the portal, then you cannot change or use the data model anymore.

  2. Click the Validate button to verify the changes.

    Validate Data Model

    On successful validation of data model, a notification appears - 'Model validated successfully'.

  3. Click the Save and Publish button on the top left corner of the editor. The data model needs to be published so that the reports using that model are updated with the latest changes.

    Save and Publish Data Model

    Note: Use the Save Draft button if you don't want to publish your changes. The report(s) using that data model would not be affected.

  4. In the Save and Publish dialog box, enter a comment if any (the added comment will appear in the revision history), and check the Update the version of the relevant documents option to update the latest version of this data model in the relevant reports. Note that this option is only available if the current data model is referenced by one or more reports.

    Save and Publish Data Model

  5. Click the Save and Publish button.