MDX for Cube Measure Based on Dimension Value

  • I would like to create a cube measure that is based upon the value of an associated dimension field. Suppose my data is:

    Employee---Type---Hours

    Rob----------Bill------10

    Jane---------Bill------20

    Fred---------Free---- 40

    I already have a measure called Hours. I would like once called Bill Hours that would return the results:

    Hours----Bill Hours

    70--------30

    I've tried the following code but do not get the correct results:

    IIF([Billing Type].[Type].Member IS [Billing Type].[Type].&[Bill],

    [Measures].[Hours], 0)

    I would like Bill Hours to properly calculate based upon how other dimensions are added to the query.

    Can someone help with the correct MDX to filter by the value of the associated dimension?

    Rob

  • How about

    SUM ( { [Billing Type].[Type].&[Bill] } , [Measures].[Hours] )

  • happycat59 (1/15/2014)


    How about

    SUM ( { [Billing Type].[Type].&[Bill] } , [Measures].[Hours] )

    That did it.

    I have really got to get through some MDX courses. Self-taught or otherwise.

    Thank you.

    Rob

  • robshobs (1/15/2014)

    That did it.

    I have really got to get through some MDX courses. Self-taught or otherwise.

    Thank you.

    Rob

    Have a go with the guide on this very site[/url] 🙂


    I'm on LinkedIn

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

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