2017-01-30 4 views
2

내가 치수 값에 따라 뭔가를 계산하려는 값 사용하려면 : 암부가 암부 경우 나는 사실는, 사용 일 또는 차원에 따라 계산에서 또 다른 조치가

WITH 
    CALCULATED MEMBER [Measures].[Switch] AS 
    IIF 
    (
     [Ambu].[Ambu].CurrentMember IS [Ambu].[Ambu].[Non Ambulatoire] 
    ,[Measures].[Nombre de Journées] 
    ,(
     [Measures].[NbSejours] 
     ,[Ambu].[Ambu].[Ambulatoire] 
    ) 
    ) 
    MEMBER result AS 
    [Measures].[RecettesT2a]/[Measures].[Switch] 
SELECT 
    { 
    [Measures].[RecettesT2a] 
    ,[Measures].[Switch] 
    ,result 
    ,[Measures].[NbSejours] 
    ,[Measures].[Nombre de Journées] 
    } ON 0 
,[Ambu].[Ambu] ON 1 
--[Classification GHM].[Recours] on 1 
FROM [Cube]; 

을 시도, 내가 원하는 Ambu가 Non Ambu 인 경우, [Nombre de Journées]로 RecettesT2a를 나눕니다. ...

Ambu가 Axis 1에서 사용되었을 때이 결과는 Ok입니다.하지만 다른 차원을 사용하려면 Ok입니다. 1 축 (예 : [분류 GHM]. [Recours])과 같이 작동하지 않습니다 ... [측정]. [스위치]가 올바르게 계산되지 않았습니다 ...

+0

기능'[암부]'여기에 사용 CURRENTMEMBER' [암부] .CurrentMember' 수단을

그래서 당신은 두 가지 옵션이 원하는 내용에 따라이 이 조건 [Ambu]. [Ambu]. CurrentMember IS [Ambu]. [Ambu.] [Ambulatoire]는 'Ambu'차원이 문맥에 있음을 의미합니다. – whytheq

+0

'[Ambu]. [Ambu]와 별개로 다른 차원을 사용하면 결과는 어떻게됩니까? [Ambul]. [Ambulatoire] )'[Measures] [Nombre de Journées] 아니면'(Nambre de Journées)'이어야합니까, 아니면'( [Measures], [NbSejours] , Ambu. – whytheq

+0

그래, 잘 이해한다면, 나에게 이런 식의 해결책이 없다. 나는 Ambu/Non Ambu 속성에 대해 이미 다른 값을 가진 사실 테이블 (그리고 새로운 측정 값)에 컬럼을 추가해야한다. –

답변

1

Ambu의 컨텍스트 밖에있을 때 필요한 항목을 알 수 없습니다.

WITH 
    CALCULATED MEMBER [Measures].[Switch] AS 
    IIF 
    (
     [Ambu].[Ambu].CurrentMember IS [Ambu].[Ambu].[Non Ambulatoire] 
     OR 
     isAll([Ambu].[Ambu].CurrentMember) 
    ,[Measures].[Nombre de Journées] 
    ,(
     [Measures].[NbSejours] 
     ,[Ambu].[Ambu].[Ambulatoire] 
    ) 
    ) 
... 
... 

나이 :.

WITH 
    CALCULATED MEMBER [Measures].[Switch] AS 
    IIF 
    (
     [Ambu].[Ambu].CurrentMember IS [Ambu].[Ambu].[Non Ambulatoire] 
     OR 
     NOT isAll([Ambu].[Ambu].CurrentMember) 
    ,[Measures].[Nombre de Journées] 
    ,(
     [Measures].[NbSejours] 
     ,[Ambu].[Ambu].[Ambulatoire] 
    ) 
    ) 
... 
... 
+0

icCube에 회원 (https://www.iccube.com/support/documentation/mdx/IsAll.php)의 isAll 함수가 있습니다. – ic3

+0

@ ic3은 매우 편리한 기능 - 내 시도를 수정했습니다. – whytheq