Creating model query subject for relational metadata

Model query subjects are based on query items in other query subjects or dimensions, including other model query subjects. By using model query subjects, you can create a more abstract, business-oriented view of a data source.

You can add any combination of objects to a query subject, such as query items, other query subjects, or dimensions. You can add stand-alone calculations and filters, and you can also embed calculations and filters in the query subject.

You can create a new model query subject by merging existing query subjects and query items Creating model query subjects based on existing objects. You can also create data source query subjects, which directly reference data in a single data source Data source query subjects, and stored procedure query subjects, which are generated from the stored procedures in a relational data source Stored procedure query subjects.

When you use a model query subject in the IBM Cognos studios, IBM Cognos Analytics uses the relationships you have defined for the model query subject, not the relationships defined for the underlying data source query subjects. If you want to ensure that the relationships defined for the underlying data source query subjects are used, do not define relationships or determinants for the model query subject.


  1. Select the namespace folder, and click Actions, Create, Query Subject.
  2. In the Name box, type a name for the new query subject.
  3. Click Model, OK.
  4. Click the Query Subject Definition tab.
  5. To add items to the model query subject, drag items from the Available Model Objects box to the Query Items and Calculations box.

    You can change the order of items and calculations. However, if the query subject contains a query item folder, you can change the order only in the Project Viewer.

  6. You can also embed a filter.

    If you add calculations or filters to a model query subject, Framework Manager must go to the data source instead of simply accessing the model.

  7. If you want to test the query subject, click the Test tab.
  8. Click OK.

    A warning displays if any modifications invalidated relationships, other query subjects, calculations, or filters.

  9. Ensure that the Usage and Regular Aggregate properties are set correctly.


You may be interested in the following related topics: