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

SSIS :Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done

SSIS Error : Object is not an ADODB.RecordSet or an ADODB.Record + Solution

SSRS : [Teradata Database] 3939 There is a mismatch between the number of parameters specified and the number of parameters required.