mdx calculated measure issue

  • Hi everyone,

    I have wriiten 2 calculated measures for my cube..

    my cal measures are:

    create member [Measures].[A]

    as

    iif([measures].[sales]=0,NULL,

    [measures].[Latencydays]/[measures].[sales]),

    visible=1

    create member [Measures].

    as

    iif([measures].[Responses]=0,NULL,

    [measures].[Latencydays]/[measures].[Responses]),

    visible=1

    but results are different from database to cube..

    those are...

    below result is from DB:

    avgsaleslatency avgResplatency latency dayssalesresponses

    Null Null 0 NullNull

    15 Null 15 1Null

    Null 23 23 Null1

    cube result

    latencydays sales responses avgsaleslatency avgresplatency

    38 1 1 38 38

    but as aggregate is sum for latencydays it showing the results as below:

    But Here what the expected result is :

    avgsaleslatency avgresponseLatency

    15 23

    can anybody correct me, if my measure are wrong or if there is any other way to fix it..

    Thanks in advance,

    Niharika

  • Hi,

    It's a little hard to tell without knowing your data structure but it seems as if your measure called "LatencyDays" needs to be split via a dimension.

    It looks as if what your cube is reporting is correct in that it's summing up ALL of your latency days (15+23=38) without the context of a dimensional member to slice it by.

    So, say you had a dimension that was joined to whatever measure group your LatencyDays measure is in, let's call it LatencyType and assume it has one attribute called LatencyType. Then your calculated measure would look like this:

    MEMBER [Measures].[SalesLatency]

    AS

    SUM([LatencyType].[LatencyType].&[Sales], [Measures].[LatencyDays])

    Hope this helps 🙂


    I'm on LinkedIn

Viewing 2 posts - 1 through 1 (of 1 total)

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