If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Subtract Sub Totals?

Started by knip, 08 Mar 2017 11:38:37 AM

Previous topic - Next topic

knip

Group                        Value

A                                10

A                                20

SubTotal                    30

B                                5

B                                6

SubTotal                    11

How do i Write an Expression to Subtract Subtotal of Group A from SubTotal of Group B. Ie, 30 - 11 = 19

AnalyticsWithJay

Assuming it's relational:


total(
CASE WHEN [Group] = 'A'
  THEN [Value]
  ELSE 0
END
)

-

total(
CASE WHEN [Group] = 'B'
  THEN [Value]
  ELSE 0
END
)


Make sure you set the aggregation properties to 'Calculated'.