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
- Create Crosstab object
- Add the Year from the Time dimension to the columns of the crosstab
- Add Product Line from Products dimension to the rows of the crosstab
- Nest [Unit price] from the Sales measures to right of Product Line
- Nest [Unit cost] from the Sales measures to the right of Product Line and below Unit Price
- Select "Product Line" in crosstab and choose 'Total' under the Aggregate button.
- Select "Unit Price" and "Unit Cost" in crosstab (use shift button to allow for selecting both) and choose 'Total' under the Aggregate button.
- Select the "Total(Unit price)" and nest this to the right of the "Total(Product line)"
- Select the "Total(Unit cost)" and nest this below "Total(Unit price)" to the right of the "Total(Product line)"
- Double-click the "Total(Product line)" and change the expression
from:
total(currentMeasure within detail [Product line])
to:
total(currentMeasure within set [Product line]) - Double-click the "Total(Unit price)" and change the expression
from:
total(currentMeasure within detail [Unit price])
to:
[Unit price] - 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"}}]
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21343181