Adding attributes to an existing view or table in a data model

You can add attributes to an existing view or table in a data model by using the HCL® Cognos® Report Studio.

Before you begin

Make sure you have completed the following tasks:

  • Created the offer attribute in the UA_OfferAttribute table.
  • Added the offer attribute to the Campaign Custom Attributes reporting schema.
  • Used the Reports SQL Generator to generate the view creation script.
  • Run the generated script in the Campaign database to update the Offer Custom Attribute reporting view, UARC_OFFEREXTATTR.

About this task

The following example task shows how to add an item to an existing view in the HCL Cognos model. For this example, assume that you need to add a custom offer attribute to the Campaign database and include it in a report.

To add the new offer attribute to the Cognos Campaign model, complete the following steps.

Procedure

  1. Make a backup of the Campaign model. Browse to the Cognos/models directory and copy the CampaignModel subdirectory.
    In a distributed Cognos environment, the models directory is on the system running the Content Manager.
  2. In Framework Manager, open the Campaign.cpf file (the project) and expand the Import View node.
  3. Under Import View, select the query object that represents the reporting view for custom offer attributes: Import View > Campaign Custom Attributes > UARC_OFFEREXTATTR.
  4. Select Tools > Update Object.

    Cognos refreshes the columns that are listed under the node for the view so they reflect all columns currently present in the UARC_OFFEREXTATTR reporting view in the Campaign database.

  5. Expand the Model View and select the node that represents custom offer attributes in this view: Model View > Campaign Custom Attributes > Offer Custom Attributes.
  6. Double-click the Offer Custom Attributes node to open the Query Subject Definition dialog box.
  7. Locate the new column and add it to the Model View.
  8. Edit the name of the query item so it can be read easily.
    For example, the column that is named LASTRUNDATE in the Import View of the Campaign data model appears as Last Run Date in the Model View.
    Note: Because the Business View contains a shortcut to the Offer Custom Attributes node in the Model View, the new query item now available in the Business View.
  9. Save the model.
  10. Publish the package to the Cognos content store.

    You can add the attribute to the appropriate report by using HCL Cognos Report Studio.