SSAS MDX Query : Like Operator type Example : Like % % search

The Like Operator in TSql is useful  like wildcard search . when we have many outputs we can filter our some based on certain input .  The same thing we can do in MdX also .

i will explain you with example .

we have folders dimension in whihc we have som many enteries  in which if we want to see only those folder names which contain  "FolderToWatch"

Then we can achieve this with the help of the filter function .

WITH MEMBER [Measures].[ParameterCaption] AS [Folder].[Folder].CURRENTMEMBER.MEMBER_CAPTION
MEMBER
[Measures].[ParameterValue] AS [Folder].[Folder].CURRENTMEMBER.UNIQUENAME SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue]} ON COLUMNS , NON EMPTY (

FILTER( [Folder].[Folder].
children ,instr([Folder].[Folder].
currentmember.Name , "FolderToWatch") )


)
on rowsFROM
[M2M]

Comments

Post a Comment

Popular posts from this blog

SSAS : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. (Microsoft.AnalysisServices.AdomdClient). + Solution

SSIS Error : Unable to infer the XSD from the XML file. The XML contains multiple namespaces