0

I have an account dimension with a parent-child hierarchy. I need to flip the signs on some of the leaf levels, so I created a calculated measure to handle this, and it works great except for one issue. The account hierarchy uses unary operators to do the proper addition/subtraction of siblings. When I use the calculated measure shown below, it no longer honors the unary operators. Is there a way to make the calculated measure honor those?

CREATE MEMBER CURRENTCUBE.[Measures].[Flipped Activity]
AS 
IIf(IsLeaf([Account].[Accounts].currentmember),
   ([Measures].[Activity] * [Measures].[AH Flip Value]),
   SUM([Account].[Accounts].currentmember.children, [Measures].[Flipped  Activity])
), 
FORMAT_STRING="$#,##0.00;($#,##0.00)",
VISIBLE = 1; 
whytheq
  • 34,466
  • 65
  • 172
  • 267
  • What version are you using? In SS 2012, there were some bugs in the way Unary Operators were handled that have been patched as recently as SP 2 CU 6 (Jun or July 2015, I believe). – Tab Alleman Oct 30 '15 at 18:59
  • I am using SQL Server 2014. – Jason Mitchell Nov 02 '15 at 17:10
  • Is the above deliberately recursive? Did you experiment with different implementations of the measure that uses the unary operator - what does that measure look like? – whytheq Nov 07 '15 at 10:02

0 Answers0