如何将带有Where条件和大小写的SQL查询转换为MDX

时间:2016-11-02 14:31:29

标签: mysql mdx

我是MDX的新手,我还回顾了SQL到MDX查询的比较。但我仍然无法掌握MDX。

我正在尝试将以下SQL转换为MDX。

SELECT CAST(A.Num AS FLOAT)/A.Denom AS "Denial Rate"
FROM (
SELECT COUNT(CASE WHEN LargestAdjustmentType = 'Denial' THEN LargestAdjustmentType end) AS Num, COUNT(*) AS Denom FROM vwremits) a

我写作写作MDX

Select [Measures].[Denial Rate]
 AS [Measures].[Count] AS [AdjustmentType].["Denial"]

你能帮帮我吗。

1 个答案:

答案 0 :(得分:0)

没有看到什么措施&你的立方体结构中存在层次结构这个问题是不可能回答的 - 所以这里是黑暗中的刺:

WITH [Measures].[Denial Rate] AS
     [Measures].[Count]
SELECT
 {} ON 0,
 [Measures].[Denial Rate] ON 1
FROM [CubeName]
WHERE [AdjustmentType].[AdjustmentType].[Denial];

或者只是:

SELECT
 [AdjustmentType].[AdjustmentType].[Denial] ON 0,
 [Measures].[Count] ON 1
FROM [CubeName];