我是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"]
你能帮帮我吗。
答案 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];