【问题标题】:Get the descendants of a member获取成员的后代
【发布时间】:2022-01-05 14:50:43
【问题描述】:

此请求始终在“nb”列中显示“1”,但我知道对于此患者,数字为“3”:

WITH
member pat1 AS [DimTransfusion].[TransfusionPatients].[PatientId].&[{09B7106A-xxxx-4B88-80D6-D1283FE990D6}]--83
set transfusPat AS Descendants(pats1,2)
MEMBER nb AS count(transfusPat)
SELECT {nb} ON 0
FROM [BDD PBM]

但是这个请求显示了正确的结果:

WITH
member pat1 AS [DimTransfusion].[TransfusionPatients].[PatientId].&[{09B7106A-xxxx-4B88-80D6-D1283FE990D6}]--83
set transfusPat AS Descendants([DimTransfusion].[TransfusionPatients].[PatientId].&[{09B7106A-FB68-4B88-80D6-D1283FE990D6}],2)
MEMBER nb AS count(transfusPat)
SELECT {nb} ON 0
FROM [BDD PBM]

我不明白为什么使用成员变量而不是实际值会给出错误的结果。

这是维度使用截图:

其中 VPARCOURS 和 VTRANSFUSION 是事实表(Transfusion 始终与一个 VPARCOURS 相关):

谢谢。

【问题讨论】:

    标签: ssas mdx


    【解决方案1】:

    问题是由于 pat1: 作为成员,我想 Descendants 函数返回其第一个参数的成员是成员,对于集合也是如此: 所以正确的声明是:

    set pat1 AS [DimTransfu...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-10
      • 1970-01-01
      相关资源
      最近更新 更多