dbTalk Databases Forums  

MDX stuck

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX stuck in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Milind
 
Posts: n/a

Default MDX stuck - 12-15-2005 , 11:53 PM






Hi

I have dimensions Person, QuestionSet, Question, Client, AnswerText and
measure Encounter

I wrote the below MDX


with member [Measures].[Enc] AS ''[Measures].[Encounter]''

set [People] as ''NonEmptyCrossJoin(except({[Person].[Person].Members},
({[Person].[All Person]})), {[QuestionSet].&[DiabetesSi]},
{[Question].&[LastBPReading],[Question].&[BPUsual]}, {[Client].&[52]},
1)"

member [Person].[Filter] as ''Aggregate([People])''

member [Measures].[Baseline] as ''([Measures].[Enc],
[QuestionSet].&[DiabetesAs])''
member [Measures].[EOP] as ''([Measures].[Enc],
[QuestionSet].&[DiabetesSi])''
member [Measures].[Post6Month] as ''([Measures].[Enc],
[QuestionSet].&[DiabetesTw])''

Select non empty{[AnswerText].members} on rows,
{[Measures].[Baseline], [Measures].[EOP], [Measures].[Post6Month]} on
columns
from DM_Answer
where
([Person].[Filter],[Answer].[Field].&[LastBPReading],[Product].&[DMD])

which gives the following output ( The answers are Blood Pressure
readings)

AnswerText [Measures].[Baseline] [Measures].[EOP]
[Measures].[Post6Month]
__________ __________________ _______________
_____________________
110/78 1 0
0
117/69 0 1
0
118/58 1 0
0
120/66 1 0
0
70/118 0 1
0

I want the following output

AnswerText [Measures].[Baseline] [Measures].[EOP]
[Measures].[Post6Month]
__________ __________________ _______________
_____________________
Normal BP 2 1
0
High BP 0 1
0

Where the logic for classification is

If the bottom # is 80 or above, record this as HIGH BP (it doesn't
matter what the top # is).
If the top # of 140 or above, record this as HIGH BP (it doesn't matter
what the bottom # is).
Anything else would be NORMAL BP.

I tried Instr function but got lost in it. Please help!!!

thanks

Milind


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.