Updating columns in a data module

After a table in a data module source is updated, you can add or remove individual columns in the data module without updating the whole table.

This functionality can be used for the following scenarios:

  • A source column was deleted from a data module table, the data module was modified and saved, and the modeler wants to re-add the deleted column to the data module.
  • A new column was added to an existing table in a database, and the modeler wants to use this column in the data module.
  • A column was removed or renamed in a database, and the modeler must update the data module to avoid validation errors.

About this task

For data modules that are based on data servers, use the Reload metadata function to reload the latest schema metadata from the database. For more information, see Reloading the schema metadata.

Procedure

  1. Open the data module that you want to update.
  2. Click the Source view icon Source view icon. to open the Sources panel, and expand the source tree.
  3. If the source is a database server schema, from the schema context menu, click Reload metadata.
    Tip: You don't need to perform this step if the database server schema was already reloaded in the Data server connections administration user interface after a database change that needs to be reflected in Cognos® Analytics. For more information, see Loading metadata.

    The tables and columns are reloaded based on the latest state of the data server.

  4. In the Sources panel toolbar, click the Source tree settings icon , and select the Show unused items check box.
    • The columns (and their tables) that are not in the data module are highlighted in the Sources panel.
    • If the source contains renamed columns, or columns were removed from the source, validation error icons Validation error icon appear next to the affected columns in the Data module panel.
  5. In the Sources panel, identify the column that you need to add to the data module, and drag the column to the related table in the Data module panel. Expand the table if you want to drop the column into a specific place in the table.

    You can drag multiple columns from the same table at once.

  6. If the data module contains validation errors, the columns in the module might be missing or renamed in the source. Use the following steps to resolve the errors:
    1. Drag the renamed columns to the Data module panel.
    2. Remove the columns that no longer exist in the source from the data module.
    3. Validate the data module.

      Potential validation errors might be related to the broken references in expressions, such as filters or calculations, that might still refer to the removed columns. Using information in the error messages, manually update these expressions.

  7. Save the data module.