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 |