Create a Physical View

Physical views can only be created for relational databases. (See JDBC or Connect to a Specific Data Source for information on how to configure a relational database data source.)

If you see the ‘Create Visualization’ dialog box, press the ‘Close’ button close and then proceed with the steps below.

200

To create a physical view, follow the steps below:

  1. Press the top ‘Data’ button database.

    dataModel1

  2. In the ‘Navigation Tree’ in the left panel, expand the ‘Data Sources’ folder. Locate the relational database data source for which you want to add a physical view. Select the ‘Data Model’ node, and press the ‘New Physical View’ button new partition.

    dataModel2

  3. Provide a name for the physical view and press ‘OK’.

    dataModel3

  4. Add tables to the physical view. Follow the steps below:

    1. Optional: To filter the list of available tables, use the ‘Search’ box to enter the name (or partial name) of the tables to which you want to restrict the listing.

      dataModel4

    2. Click to select the tables to add to the physical view. (Add all the tables from which you want the data model to be able to retrieve data.)

      dataModel5

    3. Optional: To add a custom table based on a SQL query, see Add Inline SQL in Edit a Physical View.

    4. Optional: To hide the tables you have not selected, press the ‘Only Show Selected Tables’ button eye off at the top of the ‘Tables’ panel.

    5. To display the columns within a table, press the ‘Show Columns’ button chevron circle arrow down.

  5. Add joins to create relations between the tables. To add an individual join between tables, follow the steps below. To automatically add joins between many tables, see Automatically Create Joins in Edit a Physical View.

    Physical views are susceptible to query traps that can cause unexpected results. See Identify Query Traps for more information.
    1. Click the first table in the left panel that you want to join. Drag the join handle join from the first table onto the of the second table. This opens the Join Editor.

      dataModel12

      If a join between the tables already exists, click on the join link to open the ‘Edit Join’ dialog box.

      dataModel13

      The ‘Edit Join’ dialog box allows you to modify the join operator (inner/equal, outer, or inequality), and set the cardinality, merging rule, and weak join. See Modify Join Properties for more information about these join settings.

      dataModel15

    2. Press OK to close the ‘Edit Join’ dialog box.

    3. To remove an existing join, right-click on the join link, and select ‘Remove Join Condition’.

      dataModel14

    4. To create a new join, simply drag the desired join field from one table into the other table. Repeat to create any additional joins.

      dataModel16

    5. Press Done to exit the Join Editor.

      You can also add a join by selecting a table, and pressing the ‘Add a join’ button add.

      dataModel17

      This opens the ‘Add Join’ dialog box. Choose the join column within the selected table (‘Column’) and the ‘Foreign column’ within a desired ‘Foreign table’, and press OK.

      dataModel18

  6. To edit a join, select the table from which the join is an outgoing join, and press the ‘Edit a join’ button edit. This will open the ‘Edit Join’ dialog box (see above), where you can modify the join.

    dataModel19

  7. To delete a join, select the table from which the join is an outgoing join, and press the ‘Remove the selected join(s)’ button trash.

  8. Repeat the above steps to join all tables in the physical view. (To automatically add joins between many tables, see Automatically Create Joins in Edit a Physical View.)

  9. Press the ‘Save’ button save to save the physical view.