Wednesday, March 7, 2012

MDX query to filter out members starting with a particular alphabet

Hi,

I would like to come up with an MDX query such that the query works on a subset of the members present at a particular level of a dimension. A filter would do but the subset should have all the members whose name start with alphabet falling in the range 'A' - 'K'. Is there a way to have a regular expression in the filter of the MDX query.
Do help me out on this with your suggestions.

cheers,
Arun

I would you reccomend to use pure MDX. It is the quickest method. It use indexes on hierarchies. If you use VBA fubnctions or another stuff SSAS schuld mack full scan of hierarchy and the query would be slower.

Filter([Dimension].[Hierarchy].[Level].members, ([Dimension].[Hierarchy].CurrentMember.Name >= "A" and [Dimension].[Hierarchy].CurrentMember.Name < "L"))

|||Thanks a bunch Vladimir for the timeous reply
Is it also possible to filter the members by count ? I mean can I get the first 10 members at a level in one query followed by the next 10 in another query and so on.

Thanks in advance.

Arun
|||

Maybe like this:

BottomCount( TopCount( {YourSet}, X ), 10 )

Where you control X each time you query, e.g.

BottomCount( TopCount( {YourSet}, 10 ), 10 )

BottomCount( TopCount( {YourSet}, 20 ), 10 )

BottomCount( TopCount( {YourSet}, 30 ), 10 )

Best regards

- Jens

|||Hi Jensch,

Thanks a lot. It was quite handy. Much appreciated.

cheers,
Arun

No comments:

Post a Comment