IBM Support

How to total columns in crosstab where there are measures nested on the rows

Troubleshooting


Problem

How to total columns in crosstab where there are measures nested on the rows?

Resolving The Problem

Use the "within set" clause in the total() function.

Steps: Using Go Sales (analysis) Sample package

  1. Create Crosstab object
  2. Add the Year from the Time dimension to the columns of the crosstab
  3. Add Product Line from Products dimension to the rows of the crosstab
  4. Nest [Unit price] from the Sales measures to right of Product Line
  5. Nest [Unit cost] from the Sales measures to the right of Product Line and below Unit Price
  6. Select "Product Line" in crosstab and choose 'Total' under the Aggregate button.
  7. Select "Unit Price" and "Unit Cost" in crosstab (use shift button to allow for selecting both) and choose 'Total' under the Aggregate button.
  8. Select the "Total(Unit price)" and nest this to the right of the "Total(Product line)"
  9. Select the "Total(Unit cost)" and nest this below "Total(Unit price)" to the right of the "Total(Product line)"
  10. Double-click the "Total(Product line)" and change the expression
    from:
    total(currentMeasure within detail [Product line])
    to:
    total(currentMeasure within set [Product line])
  11. Double-click the "Total(Unit price)" and change the expression
    from:
    total(currentMeasure within detail [Unit price])
    to:
    [Unit price]
  12. Double-click the "Total(Unit cost)" and change the expression
    from:
    total(currentMeasure within detail [Unit cost])
    to:
    [Unit cost]

Result:

Please find attached a report specification against the Go Sales (analyis) sample package, created in 10.2.

[{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Report Studio","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.2.2;10.2.1;10.2;10.1.1;10.1;8.4.1;8.4;8.3","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
15 June 2018

UID

swg21343181