Create a Master Detail Relationship

Create a master detail relationship to deliver information that would otherwise require two or more reports. For example, you can combine a list with a chart. The list can contain product lines and the chart can show details for each product line.

Master detail relationships must appear in nested frames to produce the correct results. You can create a master detail relationship in two ways:

  • Use a parent frame for the master query and a nested frame for the detail query.
  • Associate a report page with the master query and use a data container, such as a list or crosstab, for the detail query.

You cannot display parent data in the child frame or child data in the parent frame. Also, you cannot perform calculations across master detail queries.

When you are working with dimensional data, IBM® Cognos® Analytics - Reporting does not support master detail relationships that use a custom group.

You can use a master detail relationship to show data from separate data sources in a single report. However, the data sources must be contained in the same package.

With the dynamic query mode, master detail reports with a crosstab report object are optimized to use a single query whenever possible, rather than a separate query for each report object instance.

If you are working with an SAP BW data source, you cannot use a data item from the master query that contains non-ASCII values.

Before you begin

To create a master detail relationship using queries that reference two different dimensional data sources, you must first link the members by aliasing the levels that contain the members.

Procedure

  1. To use a parent frame for the master query and a nested frame for the detail query:
    • Click the Toolbox icon The toolbox icon and drag a List, Repeater Table, or Repeater to the report.
    • Add a second data container to the object you inserted.

      You can insert a list, crosstab, chart, repeater table, or repeater into a list. You can add a list to a repeater table or repeater.

    • Add data items to both data containers.
  2. To associate a report page with the master query and use a data container for the detail query:
    • Click anywhere in the report page.
    • Click the Show properties icon Show properties icon, and In the Properties pane, click the Select ancestor icon select ancestor icon and click Page.
    • Set the Query property.
    • Click the Toolbox icon, drag a data container to the report.
  3. To link a data item in the master query to a parameter in the detail query instead of to another data item, create the parameter in the detail query.

    Use parameters to filter values at a lower level in the detail query.

    • Click the Queries icon Queries icon, and click the detail query.
    • Click the Toolbox icon toolbox tab and drag the Filter object to the Detail Filters box.
    • In the Expression Definition box, create the parameter.
  4. Click the Pages icon Pages icon, and click the report page.
  5. Click anywhere in the report page.
  6. Click the Show properties icon, and In the Properties pane, click the Select ancestor icon and click Page.
  7. Click the data container containing the details.
  8. In the Properties pane, click the Master detail relationships property.
  9. Click New Link.
  10. In the Master box, click the data item that will provide the primary information.
  11. To link the master query to a data item, in the Detail box, click the data item that will provide the detailed information.
  12. To link the master query to a parameter, in the Parameters box, click the parameter that will provide the detailed information.
    Tip: To delete a link, select the link and press the Delete key.
  13. If your detail query object is a chart, you can disconnect a chart title from the master query.
    • Click the chart title, and from the Properties pane, click Master detail relationships.
    • Clear the Use the master detail relationships from the chart check box.
  14. If the master detail relationship includes a chart as the detail and you are using automatic axis ranges, you can set the same axis range for all the detail charts:
    • Select the axis.
    • In the Properties pane, under General, double-click the Axis range property.
    • Under Maximum and Minimum, click Automatic.

      The master detail report option is only available with automatic axis ranges.

    • Under Master detail reports, select the Same range for all instances of chart check box.

    For more information about axis ranges, see Change the axis scale of a current default chart.

    Tip: To avoid seeing the same data item twice in the report, click the data item in the data container driven by the detail query. In the report object toolbar, click the More icon More icon and click Cut. This removes the item from the report display but keeps it in the query.