MDX to Get Customer Status in given date range

  • I have a fact table that stores customer statuses based on when they last chaged. e.g.

    Customer Status DateAttained

    Cust 1 Live 20130801

    Cust 1 Suspended 20130625

    Cust 1 Live 20120901

    Cust 1 Activated 20120731

    So assuming I queried the end of year 2012, I would get a "Live Status" or if I queried their status as of 26th june 2013, I get "Suspended"

    This is straightforward for SQL but no clue how to do it in MDX.

    Thanks

  • SELECT {<<some measures>>} ON 0,

    [Customer Dimension].[Customer Status].[Customer Status] on 1

    FROM <<your_cube>>

    WHERE (NULL:[Dim Date].[Date].&[26062013])

    This code will effectively give you the customer status from Start of Date in the dimension till 26th June 2013

    Raunak J

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

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