Creating custom tables

You create a custom table by merging or copying selected tables and columns in the data module. Custom tables can be used to create new custom tables.

About this task

If the custom table is based on multiple tables, the properties of the table that was selected first are applied to the custom table. For example, the Usage or Data cache properties on the custom table are inherited from the first table. The columns in the custom table also inherit their properties, such as Label or Aggregate, from the columns in the first table.

Procedure

  1. In the data tree, from the data module, table (or multiple tables), or package context menu Context menu icon, click New > Table.

    You can also start creating a custom table from the Custom tables tab by clicking Create custom table.

  2. Select the tables and columns to add to your custom table.

    You can click the add icon Icon add table. to add new tables, or the remove icon Icon remove table. to remove tables from the list. These options are not available for a package.

    • If you initiated the process for an individual table or multiple tables, the table names appear in the Create new table dialog box, in the Selected tables pane. The table that was selected first is at the top of the list.

    • If you initiated the process from the data module context menu, no table names appear in the Selected tables pane initially. Click Select tables to add tables that are already in the data module.

    • If you initiated the process from a package context menu, the Create a joined view dialog box is displayed. Only this option is available for packages because tables that are sourced from packages can be used to create views only. Only relational objects in the package are visible. OLAP objects aren’t visible.

      Finish creating the view.

  3. Depending on your selection of tables in the previous step, one or more of the following options are available to create the new table. Select one option.
    Create a copy of a table
    This option is available when one table is selected. You can copy all columns from the table, or only the columns that you select. The new table is disassociated from the base table so changes in one table aren’t reflected in the other table. When you copy a non-custom table, the result is a non-custom table. When you copy a custom table, the result is a custom table.
    Create a view of a table
    This option is available when one or more tables are selected. The columns in the base tables are referenced in the view. The column properties in the view are independent from the base table. You can select or deselect columns to include in your new table.
    Create a joined view
    This option is available when two tables are selected. You can select or deselect columns to include in your new table. Proceed to create a join between the two tables. For more information, see Creating a relationship.
    Create a union of tables
    This option is available when two or more tables are selected. All selected tables have the same number of columns. The columns are in the same order, and their data types are compatible. The new table includes all rows from all selected tables.
    Tip: The help icon in the product provides information about incompatible data types when columns with such data types are discovered.
    Create an intersect of tables
    This option is available when two tables are selected. Both tables have the same number of columns. The columns are in the same order, and their data types match. The new table includes only rows that are shared between the two tables.
    Create an except of tables
    This option is available when two tables are selected. Both tables have the same number of columns. The columns are in the same order, and their data types match. The new table includes only rows that exist in the first table.
  4. Proceed with the option-specific steps, and then click Finish.

    The custom table diagram appears on the Custom tables tab.

    Also, the table name is added to the list view on the Custom tables tab, and at the top of the data tree.

    Note: Copies of non-custom tables are not considered custom tables and don't have query flow diagrams.
  5. Save the data module.

What to do next

To view the custom table diagram later, from the table context menu in the data tree, select View definition. The same option is available for the table from the list view on the Custom tables tab.

To edit the custom table, select the related edit option from the table context menu in the data tree. For example, it the custom table is a joined view, the edit option is Edit joined table. The same option is available from the custom table diagram on the Custom tables tab.

To change the custom table name, open the table Properties, and on the General tab, modify the Label property.

In custom tables that were created by using the union, intersect, and except operations, duplicate columns are removed by default. To include the duplicates, from the table context menu, click Properties, and under Advanced, set the Duplicates property to Preserve.