MDX help

  • I have a calculation similar to below that I need to do without defining a seperate member (it's for a graph web part in sharepoint so have limited options), is there a way of doing this? {([Dim1].[All].[Yes],[Measures].[Number])} is fine, but {100 * ([Dim1].[All].[Yes],[Measures].[Number])} causes an error.

    WITH

    MEMBER [Measure].MyCalc] As

    ' 100 * ([Dim1].[All].[Yes],[Measures].[Number]) / ([Dim1].[All].[Yes],[Measures].[Number])', SOLVE_ORDER = 1 , FORMAT_STRING = '##.##'

    select

    {[Measure].[MyCalc]} on columns

    from

    [myCube]

    thanks,


    Phil Nicholas

  • Hey Phil,

    I think the problem is probably in where the *100 is.  Have you tried {([Dim1].[All].[Yes], ([Measures.[Number] * 100))} ?  This should multiply the measure value by 100 rather than trying to multiply the tuple by 100.

     

    Steve.

  • select

    {[100 * ([Dim1].[All].[Yes],[Measures].[Number]) / ([Dim1].[All].[Yes],[Measures].[Number])}on columns

    from

    [myCube]

     
    or
     

    select

    {100 * ([Dim1].[All].[Yes],[Measures].[Number])}on columns

    from

    [myCube]

     
    or
     

    select

    { ([Dim1].[All].[Yes],[Measures].[Number]) * 100}on columns

    from

    [myCube]

     
    all generate a syntax error..


    Phil Nicholas

  • Operations are not permited in the select clause, you have to create a new calculated member, something like this:

    with member [Measures].[Calculated] as '([Dim1].[All].[Yes],[Measures].[Number]) * 100'
    select

    { [Measures].[Calculated] }on columns

    from

    [myCube]

  • Thanks for the confirmation, I'll have to get back to the tool provider to get a work around..


    Phil Nicholas

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply