Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX - SSAS, getting result count of last measurement within a period


MDX - SSAS, getting result count of last measurement within a period

Author
Message
Jens Henrik
Jens Henrik
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 17
Hi I am having trouble trying to write some MDX code.
I am trying to get the last measurement result pr. person within a period. I have the following measurements and results:


Person Measurement result Date
1 1 overweight 2011-01-01
1 2 Normal 2011-03-01
2 3 Underweight 2011-01-01
2 4 Underweight 2011-02-01
2 5 Normal 2011-03-01
1 6 overweight 2012-01-01



Right now I am only able to get a normal count on measurements and distinct count on persons. So I can create a table like this (Full period):

Number of persons Number of measurements
Overweight 1 1
Normal 2 3
Underweight 1 2



But I would like to have only the last category within my chosen period, so it looks like this (Full period):


Number of persons Number of measurements
Overweight 1 1
Normal 1 1
Underweight 0 0


But it should also be able to create a table like this for the period (year 2011)


Number of persons Number of measurements
Overweight 0 0
Normal 2 2
Underweight 0 0


My dimensions and measurements are like the following:

[Measures].[Numb persons]
[Measures].[Numb measurements]
[Registrationdate].[Date]
[Person].[ID]
[result].[Name]


I hope someone can help me
thanks in advance

Br
Jens H
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