V.Bravo V.Bravo - 1 year ago 110
MySQL Question

How to Convert SQL query with Where condition and case to MDX

Im new to MDX and I also reviewed the SQL to MDX Query comparison. But still Im not able to get the hang of MDX.

I'm trying to convert the below SQL to MDX.

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

Ive writtrying to write as MDX

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

Could you please help me.

Answer Source

Without seeing what measures & hierarchies exist in your cube structure this question is impossible to answer - so here is a stab in the dark:

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

Or just:

 [AdjustmentType].[AdjustmentType].[Denial] ON 0,
 [Measures].[Count] ON 1
FROM [CubeName];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download