Monday, March 19, 2012

Measure Expression in Query ?

Hi - I want to do a query like this, in management studio, but it is giving me an error message.

select sum({TopCount([Asset].[Asset].[Asset].members,5,([Portfolio].[Portfolio].&[DD2342342],[Measures].[Value Base]))}, [Measures].[Portfolio Weighting]) on columns
from [MIQB Daily]

I tried different strto.. functions but didn't find any proper solution.

The Axis0 function expects a tuple set expression for the argument. A string or numeric expression was used.

Thanks

Noordin

Hi Noordin,

Unfortunately you can't just insert an MDX expression that returns a value on an axis - you have to declare a calculated member first, use the expression as its definition, and then place the calculated member on the axis. Here's an example from Adventure Works:

with member measures.demo as

sum(topcount([Date].[Date].[Date].members, 5, [Measures].[Internet Sales Amount]), [Measures].[Internet Sales Amount])

select {measures.demo, [Measures].[Internet Sales Amount]} on 0,

[Product].[Category].members on 1

from

[Adventure Works]

HTH,

Chris

|||

Thanks Chris,

Actually I was playing with Excel 2007 cube... formulas ... may be I need to do some work around.

do you have an idea of #IND value, what does it mean, is it infinity?

Regards

Noordin

|||I'm afraid I don't have an install of Office 2007 handy at the moment, so I'm not sure. Anyone else? #IND isn't what AS will return for infinity though - it returns 1.#INF.

No comments:

Post a Comment