Master Detail Reports

download Master Detail Reports

of 4

Transcript of Master Detail Reports

  • 7/29/2019 Master Detail Reports

    1/4

    Master Detail is used to deliver information that would otherwise required two or more Reports.

    For example, you can combine a list with a chart.

    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

    Create a Master Detail Relationship

    Create a master detail relationship to deliver information that would otherwise require twoor 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. Youcan 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 listor 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.

    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.

    To create a master detail relationship using queries that reference two different dimensional

    data sources, you must firstlink the membersby aliasing the levels that contain themembers.

    Master Detail or Burst Reports with Charts or Crosstabs May Result

    in Denial of ServiceWhen running a master detail or burst report that includes a chart or crosstab, disk spaceexhaustion may cause the report or other requests to fail. A large set of burst keys ormaster rows may produce one or more charts per detail, resulting in many master detail

    executions. This may cause the temp folder to accumulate many gigabytes of temporary

    files containing data required for successful chart rendering.

    To avoid this issue, we recommend that you test large master detail or burst reports thatinclude charts or crosstabs to determine the potential peak disk requirements for the report.

    How do you create a Master DetailRelationship in Cognos 8

    http://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/topic/com.ibm.swg.im.cognos.ug_cr_rptstd.8.4.0.doc/ug_cr_rptstd_id12005cr_rptstd_modrep_create_master_deta.html#cr_rptstd_modrep_use_caption_functionhttp://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/topic/com.ibm.swg.im.cognos.ug_cr_rptstd.8.4.0.doc/ug_cr_rptstd_id12005cr_rptstd_modrep_create_master_deta.html#cr_rptstd_modrep_use_caption_functionhttp://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/topic/com.ibm.swg.im.cognos.ug_cr_rptstd.8.4.0.doc/ug_cr_rptstd_id12005cr_rptstd_modrep_create_master_deta.html#cr_rptstd_modrep_use_caption_functionhttp://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/topic/com.ibm.swg.im.cognos.ug_cr_rptstd.8.4.0.doc/ug_cr_rptstd_id12005cr_rptstd_modrep_create_master_deta.html#cr_rptstd_modrep_use_caption_function
  • 7/29/2019 Master Detail Reports

    2/4

    Associate the master query to a Page break so that the two

    Queries are not at the same level. Query 1 is associated to thePage Break, Query 2 is associated to the List.

    Steps:These steps describe how to have two lists on a single page, andhave a Master Detail relationship between them.

    1. Open Report Studio and insert two lists on one page.

    2. Add the required columns to both lists.3. In the master list, group the column that is to be used as the

    link in the master detail relationship.

    4. Insert a filter into the master list so that you only see the

    records that you want to see in the child list.5. From the View menu, select 'Report Pages'

    6. Click anywhere on Page1 to enable the 'Properties' pane on the

    bottom left of the screen.7. In the Properties pane, under 'Data\Query' link the master

    query to the page.

    8. Double-click anywhere on Page1 to return to the report layout

    screen.9. Click anywhere on the detail query. From the 'Data' menu,

    click 'Master Detail Relationships'.

    10. Create a 'New Link' to establish the appropriate relationshipbetween the two queries.

    11. Click 'OK'

    Steps:

    1. Insert two lists on one page

    2. Add the columns to both lists

    3. Group the column in the master list that is to be used as the link in the Master Detail relationship.

    4. Insert the filter into the master list so that we only see the records that we want to see in the child

    list.

    5. Filemenu-> Pages.

    6. Create a page break and select the master query from the drop down menu

    7. Select the Page breaks by Grouping Level radio button and select the column grouped on.

    http://cognosforums.com/forums/viewtopic.php?f=14&t=59http://cognosforums.com/forums/viewtopic.php?f=14&t=59http://cognosforums.com/forums/viewtopic.php?f=14&t=59http://cognosforums.com/forums/viewtopic.php?f=14&t=59
  • 7/29/2019 Master Detail Reports

    3/4

    8. Click OK twice.

    9. From the Data menu, select Master / Detail Relationship.

    10. Click New, and select Filtered Detail Query for this example.

    11. Select the second query.

    12. Click OK and enter the expression that will link the two queries together (ex: MasterQuery.field1 =

    DetailQuery.field1).

    13. Run the report

    A master-detail query is an outer join. It is useful when you want to include ALL records in the masterquery regardless of whether there are matching records in the detail query or not. (These instructions arebased on CRN V7 MR3.)

    1. On a blank report page, drag in a new list item (called MasterQuery in this example). Populate it asneeded.

    2. Drag in a new list item (called DetailQuery in this example) and drop it into one of the columns of theMasterQuery list. Populate this list as needed. One of these fields (called ID in this example) must berelated to an associated field in the MasterQuery list to link the two queries. This step must be donecorrectly to allow DetailQuery to be an available selection in Step 5 below.

    3. On the Menu Bar, select Data > Master/Detail Relationships...

    4. Select MasterQuery in the top listbox.

    5. Add DetailQuery as a filtered query and set MasterQuery.ID=DetailQuery.ID. If DetailQuery is notshown as an available detail query selection, then double-check that you performed Step 1 correctly.

    6. Run your report.

    Some further notes: You can add multiple detail queries to a single master query. You can enhance theappearance of the report by hiding the detail query list headers as desired.

    Master - Detail RelationshipA master-detail query is an outerjoin. It is useful when you want to include ALL records in the master

    query regardless of whether there are matching records in the detail query or not.

    1. On a blank report page, drag in a new list item (Master). Populate it as needed.

    2. Drag in a new list item (Detail) and drop it into one of the columns of the Master list. Populate this

    list as needed. One of these fields (ID) must be related to an associated field in the Master list to link

    the two queries. Thisstepmust be done correctly to allow Detail to be an available selection in Step 5

    below.

    http://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.html
  • 7/29/2019 Master Detail Reports

    4/4

    3. On theMenuBar, select Data > Master/Detail Relationships

    4. Select Master in the top listbox.

    5. Add Detail as a filtered query and set Master.ID=Detail.ID. If Detail is not shown as an available

    detail query selection, then double-check that you performed Step 1 correctly.

    6. Run your report.

    Some further notes: You can add multiple detail queries to a single master query. You can enhance the

    appearance of the report by hiding the detail query list headers as desired.

    http://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.htmlhttp://mycognos.blogspot.com/2009/03/master-detail-relationship.html