2016-07-19 3 views
0

결과 집합을 표시하는 데 2 ​​분이 걸립니다. 검색어를 최적화 할 수있는 방법이 있습니까?MDX : 쿼리 최적화

WITH MEMBER [Measures].[TestMeasure] AS 
    ( 
    [Measures].[EnrollPatientCnt] 
    + [Measures].[AssessmentPatientCnt] 
    + [Measures].[ProgramAssessmentPatientCnt] 
) 
MEMBER [Measures].[TotalCount] AS 
    Count( 
    NonEmpty(
    ( 
     { [DimAssessment].[AssessmentText].[AssessmentText] }, 
     { [DimAssessment].[QuestionText].[QuestionText] }, 
     { [DimAssessment].[AnswerText].[AnswerText] } 
    ) 
    ,{ 
     [Measures].[AssessmentPatientCnt] 
    , [Measures].[TestMeasure] 
    } 
)) 
SELECT 
    NON EMPTY [Measures].[TotalCount] ON COLUMNS 
FROM [NavigateCube] 
WHERE 
    (
    { 
     ( 
     { 
     [DimManagedPopulation].[ManagedPopulationName].&[1034]&[TC Tammy Brown Care Team] 
     } 
    ) 
    } 
); 

답변

0

이 쿼리는 어떻게 수행됩니까?

WITH MEMBER [Measures].[TestMeasure] AS 
    IIf(
    Not(IsEmpty([Measures].[EnrollPatientCnt])) 
    or Not(IsEmpty([Measures].[AssessmentPatientCnt])) 
    or Not(IsEmpty([Measures].[ProgramAssessmentPatientCnt])) 
    ,1 
    ,Null 
) 
MEMBER [Measures].[TotalCount] AS 
    Sum (
    ({ [DimAssessment].[AssessmentText].[AssessmentText] }, 
    { [DimAssessment].[QuestionText].[QuestionText] }, 
    { [DimAssessment].[AnswerText].[AnswerText] }), 
    [Measures].[TestMeasure] 
) 
SELECT NON EMPTY [Measures].[TotalCount] ON COLUMNS 
FROM [NavigateCube] 
WHERE (
{ 
    ({ [DimManagedPopulation].[ManagedPopulationName].&[1034]&[TC Tammy Brown Care Team] }) 
}) 

은 동일은 아니지만, Mosha에 대한 here을 블로그 것과 비슷한 개념이다. 기본적으로

+0

그렉 -'mdx' 태그가 문서에 대한 제안되었다 - 우리가이 태그에 대한 문서를 작성하기 위해 여러 표를 필요로하는 당신이 당신의 투표를하시기 바랍니다 추가 할 수 있습니다 : – SouravA

+0

@greg - 놀랍게도, MS가 아마도 연속적인 일련의 공격에 짜증을 냈을 것이기 때문에 포함 된 링크가 더 이상 작동하지 않습니다. – whytheq

+0

@whytheq가 머리를 고맙게 생각합니다. 결정된. Mosha는 이제 Microsoft에 있지 않습니다. – GregGalloway

0

그렉/Mosha와 같은 접근 방식 :

WITH 
MEMBER [Measures].[TestMeasure] AS 
    [Measures].[EnrollPatientCnt] 
    + [Measures].[AssessmentPatientCnt] 
    + [Measures].[ProgramAssessmentPatientCnt] 
MEMBER [Measures].[MeasureIsEmpty] AS 
    IIF(
     NOT ISEMPTY([Measures].[TestMeasure]) 
    OR NOT ISEMPTY([Measures].[AssessmentPatientCnt]) 
    ,1 
    ,NULL 
) 
MEMBER [Measures].[TotalCount] AS 
    SUM(
    [DimAssessment].[AssessmentText].[AssessmentText] 
    *[DimAssessment].[QuestionText].[QuestionText] 
    *[DimAssessment].[AnswerText].[AnswerText] 
    ,[Measures].[MeasureIsEmpty] 
) 
SELECT 
    NON EMPTY [Measures].[TotalCount] ON 0 
FROM [NavigateCube] 
WHERE [DimManagedPopulation].[ManagedPopulationName].&[1034]&[TC Tammy Brown Care Team]; 
+0

안녕하세요 @ 위양자, 위의 쿼리는 나에게 많은 도움이됩니다. u – Deepthi

+0

감사합니다. 이것은 일종의 도움이었습니다. – whytheq