加减法可以,但除法不行

Addition and substraction Ok, but not Division

使用以下 Calc 成员:

create calculated member [NbJoursNonAmbuTemp] as 
   sum([Ambu].[Ambu].[Ambu].[Non Ambulatoire], [Nombre de Journées])
create calculated member [NbJoursNonAmbuFinal] as 
    IIF( [Ambu].[Ambu].current is [Ambu].[Ambu].[Ambulatoire], 0, divN([NbJoursNonAmbuTemp], 1 , null)   )
create calculated member [NbSejoursNonAmbuTemp] as 
    sum([Ambu].[Ambu].[Ambu].[Non Ambulatoire], [NbSejours])
create calculated member [NbSejoursNonAmbuFinal] as 
    IIF( [Ambu].[Ambu].current is [Ambu].[Ambu].[Ambulatoire], 0, divN([NbSejoursNonAmbuTemp], 1 , null)   )

以下 MDX:

WITH 
  MEMBER toto AS 
    Sum
    (
      CrossJoin
      (
        Descendants
        (
          [Classification GHM].[DA_GP_GA_GHM].CurrentMember
         ,[Classification GHM].[DA_GP_GA_GHM].[GHM]
         ,SELF
        )
       ,Descendants
        (
          [Periode].[Periode].CurrentMember
         ,[Periode].[Periode].[Année-L]
         ,SELF
        )
      )
     ,
        [Measures].[NbSejoursNonAmbuFinal] * [Measures].[dsmFrance]
      / 
        [Measures].[NbJoursNonAmbuFinal]
    ) 
SELECT 
  {
    toto
   ,[Measures].[NbJoursNonAmbuFinal]
  } ON 0
 ,[Classification GHM].[DA_GP_GA_GHM].[All-M] ON 1
FROM [Cube]
WHERE 
    {
      [Etablissement].[Lieu établissement].[Etablissement-L].&[720016724]
    }
  * 
    {[Periode].[Periode].[Année-L].[2014]};

没有给出 toto 的期望值...

但是如果不是(除法)

,([Measures].[NbSejoursNonAmbuFinal] * [Measures].[dsmFrance]) / [Measures].[NbJoursNonAmbuFinal]

我试试(加法)

,([Measures].[NbSejoursNonAmbuFinal] * [Measures].[dsmFrance]) + [Measures].[NbJoursNonAmbuFinal]

或(减法)

,([Measures].[NbSejoursNonAmbuFinal] * [Measures].[dsmFrance]) - [Measures].[NbJoursNonAmbuFinal]

一切都计算正确...

我做错了什么?

感谢@whytheq 的建议,我使用 :

取得了良好的效果
WITH 
  MEMBER HospidiagWIP AS 
    Sum
    (
      CrossJoin
      (
        Descendants
        (
          [Classification GHM].[DA_GP_GA_GHM].CurrentMember
         ,[Classification GHM].[DA_GP_GA_GHM].[GHM]
         ,SELF
        )
       ,Descendants
        (
          [Periode].[Periode].CurrentMember
         ,[Periode].[Periode].[Année-L]
         ,SELF
        )
      )
     ,
      [Measures].[NbSejoursNonAmbuFinal] * [Measures].[dsmFrance]
    ) 
    MEMBER [Measures].[IPDMS HospidiagTest] as HospidiagWIP / [Measures].[NbJoursNonAmbuFinal]  , format_string='0.000'
SELECT 
  {
   [Measures].[IPDMS HospidiagTest]
   ,[Measures].[IPDMS]
  } ON 0
 ,[Classification GHM].[DA_GP_GA_GHM].[All-M] ON 1
 // ,{[Classification GHM].[DA_GP_GA_GHM].[All-M]} * {[Periode].[Periode].[Année-L].[2013], [Periode].[Periode].[Année-L].[2014]} ON 1

FROM [Cube]
WHERE 
    {
      [Etablissement].[Lieu établissement].[Etablissement-L].&[720016724]
    }
  * 
    {[Periode].[Periode].[Année-L].[2014]}

尝试以下操作并检查结果 - 它有助于分析引擎在做什么吗?

尝试执行解决顺序。

WITH 
  MEMBER PREtoto AS
        [Measures].[NbSejoursNonAmbuFinal] * [Measures].[dsmFrance]
      / 
        [Measures].[NbJoursNonAmbuFinal]
     ,SOLVE_ORDER = 1
  MEMBER toto AS 
    Sum
    (
      CrossJoin
      (
        Descendants
        (
          [Classification GHM].[DA_GP_GA_GHM].CurrentMember
         ,[Classification GHM].[DA_GP_GA_GHM].[GHM]
         ,SELF
        )
       ,Descendants
        (
          [Periode].[Periode].CurrentMember
         ,[Periode].[Periode].[Année-L]
         ,SELF
        )
      )
     ,
      PREtoto
    ) 
    ,SOLVE_ORDER = 2   //<<or try the other way by changing to -1
SELECT 
  {
    PREtoto
   ,toto
   ,[Measures].[NbJoursNonAmbuFinal]
  } ON 0
 ,[Classification GHM].[DA_GP_GA_GHM].[All-M] ON 1
FROM [Cube]
WHERE 
    {
      [Etablissement].[Lieu établissement].[Etablissement-L].&[720016724]
    }
  * 
    {[Periode].[Periode].[Année-L].[2014]};