Friday, March 9, 2012

MDX Question

Hi,
Assume all of members are {NewYork, London, Chicago, Miami, LosAngeles} in a dimension.

I want the members which name is lead of 'L' as MDX axis(0). That mean I want {London, LosAngeles} be MDX axis(0).

In Sql, we can use "like L%".
How to do this in MDX?

thanks,

You can use the MDX Filter() function in combination with various VBA functions such as Left(), Right(), Mid():

SELECT
FILTER([Cities].members, VBA!Left([Cities].CurrentMember, 1) = "L")) ON 0
FROM [Cube]

(I am reciting this from memory so the syntax might not be a 100% right, but you get the idea)|||thanks a lot...:)

No comments:

Post a Comment