Tuesday, February 14, 2012

Calculating Length of a Member in MDX

hi,

can we calculate the length of any member in mdx query?i have a dimension having searched keywords like a,aa,abc,abcd... and so on.i want to filter the data based on length of these characters .Is it possible in mdx query?i am using MS sql server analysis services 2005.

Thanks

This is not too hard.

You would use something like Filter([Product].[ProductCode].members, vba!len([Product].[ProductCode].Currentmember.Name) = 3)

Another alternative that might give you better performance if you are going to do a lot of filtering on the length would be to calculate the length in a calculated column in the DSV and add it as an attribute to the dimension, in this way it can be indexed by SSAS rather than being calculated on the fly.

|||

Thanks for the Quick Reply Darren.

But in mdx i didnt find any function as you mentioned "vballen".i suppose this means variable length.can u suggest me how do i create such function in mdx?

Thanks

No comments:

Post a Comment