I have a business requirement to Obscure low numbers for Confidentiality.
I have been trying to do this using a hidden measure and a calculation. The hidden measure is named 'Encounters_Count' and the MDX I'm using for the calculation is:
CREATE MEMBER CURRENTCUBE.[Measures].[Number of Encounters]
AS IIF( [Measures].[Encounters_Count] <= 5, "<hidden>", [Measures].[Encounters_Count] ),
FORMAT_STRING = "#,##0", NON_EMPTY_BEHAVIOR = { [Encounters_Count] }, VISIBLE = 1;
This works except that in some cases it's possible to work out the hidden numbers from the group totals.
I've tried to write a recursive Calculation using IsLeaf() to exclude "<hidden>" results from the total by applying different rules depending on if it's the parent or child but I can't work out how to do this correctly.
This is what I've been trying to do:
...
IIF( IsLeaf( [Measures].[Encounters_Count] ),
IIF( [Measures].[Encounters_Count] <= 5, "<hidden>", [Measures].[Encounters_Count] ),
SUM( IIF( [Measures].[Number of Encounters] <> "<hidden>", [Measures].[Number of Encounters], NULL ) )
),
...
Edit: Here is a screenshot of what I'm trying to avoid, in this case you can work out that the <hidden> number is 4. It would be preferable for the Grand Total to show 31,163 as that is the total of the Visible numbers.
Once you start hiding numbers and fiddling with totals, the report becomes less accurate...so... if your business users are saying they are happy with inaccuracy, why not think of other ways to achieve your goal (before thinking of MDX)?
You could add 5% to all totals / replace the right-most digit with "8" / round up to the nearest 100...
Do this to all totals, and you MDX doesn't have to worry about IsLeaf() or whether some of the totals have hidden values within them and some don't.