Adding a crosstab to a blank report

About this task

A crosstab (cross table) shows the relationship between two or more sets of data; for example the number of wikis added compared to the number of forums added in the past year. The simplest form of crosstab shows one Measure, one set of Categories, and one Data series. The example report created in the instructions that follow uses a crosstab to display the same data as in the example trend chart created in Adding a trend chart to a report; in this example the report will display as a table instead of a line chart.
Note: Earlier examples added the Measures to a report first but in a crosstab, the measure appears within each cell of the table's data area, so it will be added last to keep the instructions clear.

For more information on the dimensions (Measures and Categories) available in the Metrics PowerCube, see PowerCube dimensions. For more information on working with Cognos® Report Studio, see the Report Studio User Guide.

Procedure

  1. Create a blank report as described in Creating a blank report from the PowerCube model.
  2. Place a crosstab object in the report layout:

    A crosstab displays as a table with areas marked for you to add rows, columns, and measures to the report.

    1. Click the Toolbox tab.
    2. In the Toolbox window, select the Crosstab object and drag it to the design area.
  3. Select the Categories to display in the rows of the crosstab:

    In this example, the categories are the years for which "create" events are being counted (the DATE): 2010, 2011, and 2012; each row in the crosstab will represent a year.

    1. Click the Sources tab.
    2. In the packages list, expand the METRICS_TRX_CUBE datasource, and then expand the DATE dimension.
    3. Expand Members > DATE.
    4. Select 2010 and drag it to the Rows area of the crosstab.
    5. Select 2011 and drag it to the Rows area of the crosstab, placing it after 2010.
    6. Select 2012 and drag it to the Rows area of the crosstab, placing it after 2011.
  4. Select the data series to display in the column of the crosstab:

    In this example, the data series is the type of event being counted: the CREATE; the data series appears in a column of the table (if your report includes multiple data series, each data series would be placed in a different column).

    1. Return to the METRICS_TRX_CUBE datasource.
    2. Expand Members > EVENT, and then expand the EVENT dimension.
    3. Select CREATE and drag it to the Columns area of the crosstab.
  5. Select the Measure to display on column of the crosstab:

    In this example, the measure is EVENT_COUNT; each cell within the crosstab will display the number of "create" events for the year represented by the current row.

    1. Return to the METRICS_TRX_CUBE datasource.
    2. Expand Measures and select EVENT_COUNT; then drag it to the Measures area of the crosstab.
  6. Click Save to save the updated report.
  7. Click Run > Run Report - HTML to test the report by viewing it in the Cognos® Viewer; then close the viewer when ready to proceed.