locked
How to get meacure value for a sibling attribute in MDX RRS feed

  • Question

  • Hi,

    I have a table with the following data

    Activity Id Last   Activity Id
    1 NULL
    2 NULL
    3 NULL
    4 NULL
    5 3
    6 2
    7 3
    8 1
    9 4

    I have created a dimension "Activity" with 2 attributes : ActivityId, LastActivityId

    I have a Fact table like this :

    Activity Id Count   of Activities
    1 10
    2 12
    3 34
    4 45
    5 32
    6 23
    7 56
    8 34
    9 56

    Now getting the count by activity is straight forward, But what I need to get is the count of last activity per activity. So if I select Activity 9 the measure value should not show me 56 but should show me 45 which is count for Activity 4 as Activity 4 is the last activity for Activity 9.

    So essentially if I take all activities this is what the result of MDX should be :

    Activity Count of Activities (Last)
    1 NULL
    2 NULL
    3 NULL
    4 NULL
    5 34
    6 12
    7 34
    8 10
    9 45

    Any suggestions on how to achieve this will be helpful.

    - Girija


    Please mark responses as answered if it helped you.. This helps others... - Girija Shankar Beuria

    Monday, September 8, 2014 4:57 AM

All replies