MDX "Like"


 

i new mdx. in sql have wild card search. example. select * products product "aa%".we records product start aa. how same in mdx?

hi rakam,

 

the easiest way achieve using filter function to filter members caption property following sintax:

code block

select non empty filter([product].[product].members,

left([product].[product].currentmember.properties("caption"),1) = "m") on rows,

[measures].[internet sales amount] on columns

from [adventure works]

 

 

 

but has drawbacks when querying big sized cubes filtering scan every dimension member.

you can otherwise create user hierarchy groups products first letter instead of filtering member can select product group following:

 

hierarchy: product letter

-----------------------------------

first letter group

product

 

so can build mdx this:

 

code block

select [products].[product letter].[first letter group].[a] on rows

measures.[internet sales] on columns

from [adventure works]

 

 

 

bye


SQL Server  >  SQL Server Analysis Services



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........