Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

MDX Query - Multiple Conditions For Data Masking Using 'Case' or 'IIF' functions

$
0
0

Hi,

I want to mask data with "--" for Measures data  and several Dimensions in a query for a report . 

Below code shown is where I was able to Mask the Measure Values in [Pay Amount1] using the Case statement condition "[UP System].[Show Cost Flag] = Y".

But I also need to Mask the Data for the Dimension Field"[Member].[Member ID].[Member ID].MEMBERS" in the row corresponding to the condition "[UP System].[Show Cost Flag] = Y".

I need piece of code with the CASE statement fulfilling the above condition for Dimension data Masking as shown in RED circle in the picture for the corresponding Y's. The green circle shown in the picture is what I can mask in Measure field using the below query.

with member [Measures].[Pay Amount1] as

Case [UP System].[Show Cost Flag].currentmember.name When "Y" Then "---" Else [Measures].[Pay Amount] End SELECT { [Measures].[Pay Amount1] } ON COLUMNS, ORDER ( TOPCOUNT ( NONEMPTY ({ [AccPhy Grouping].[Level2 Abbrev].[Level2 Abbrev].MEMBERS * [AccPhy Grouping].[Level3 Name].[Level3 Name].MEMBERS * [Member].[Member Full Name].[Member Full Name].MEMBERS * [Member].[Member Currently Active].[Member Currently Active].MEMBERS * [Member].[Member ID].[Member ID].MEMBERS * [UP System].[Show Cost Flag].[Show Cost Flag]},[Measures].[Pay Amount]) , 12, [Measures].[Pay Amount] ) , [Measures].[Pay Amount], Bdesc) ON ROWS FROM [MyDW]






Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>