0

在此处输入图像描述

我们正在使用 don't net 应用程序使用 MDX 脚本编写自定义报告。我是编写 MDX 查询的新手。任何人都可以帮助从以下问题中获取数据。

  1. 对于每个 CPKey,我们都有患者列表
  2. 对于患者暗淡表中可用的每个患者信息。

当我从 MDX 的 dot net 应用程序获得 CPKey 时,如何从 Patient DIM 表中检索患者信息作为列?

预期结果集如下

PatientID   PatientName MemberNum   Phone   Age Gender  Conditions
1   abc 12345   111111  25  F   NULL

![Sql >>>>>
Select  p.* from 
 ConditionprevalencePatient  cpp
Inner join patient p
On p.Patientid = cpp.Patient

MDX ???????][2]
4

1 回答 1

1

我不确定条件,并且您在问题中的屏幕截图有一些被表覆盖的关系线,但是 MDX 查询看起来像:

SELECT {} ON COLUMNS,
       [Patient].[Patient ID].[Patient ID].Members
       *
       [Patient].[PatientName].[PatientName].Members
       *           
       [Patient].[MemberNum].[MemberNum].Members
       ...
       ON ROWS
  FROM [YourCubeName]
 WHERE {
       [ConditionPrevalencePatients].[ConditionPrevalenceKey].[12345],
       [ConditionPrevalencePatients].[ConditionPrevalenceKey].[67890]
       }

MDX 与 SQL 有很大的不同,即使在第一次查看时,您也认出了一些关键字。

于 2013-07-26T15:04:26.573 回答