SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX to Get Customer Status in given date range


MDX to Get Customer Status in given date range

Author
Message
mashadaG
mashadaG
SSC Rookie
SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)

Group: General Forum Members
Points: 37 Visits: 85
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
Raunak Jhawar
Raunak Jhawar
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3701 Visits: 1944


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

Regards/Raunak
Now a member of Linkedin

Please visit the all new Performance Point Forum
Please visit the all new Data Mining and Business Analytics Forum
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search