I have a fact table with structure:
I need the equivalent MDX for the following SQL:
I tried with the following MDX but it's showing wrong results. It's showing sum(duration) instead of showing max value for each grouping:
In all cases it shows the same result which is the sum of duration per group.
Please help me by providing the correct MDX which can answer the queries like the above SQL.
Code:
(objectid, fromLoc, toLoc, duration)
Code:
select fromLoc, toLoc, max(duration) from fact group by fromLoc, toLoc;
Code:
WITH
MEMBER [Measures].[MaxValue] AS
max([Measures].[Duration])
-- Also tried max(FromLoc.members, [Measures].[Duration])
-- Also tried max(Object.objectid.members, [Measures].[Duration])
select FromLoc.members on axis(1),
toLoc.members on axis(0)
from [cube1]
where [Measures].[MaxValue]
Please help me by providing the correct MDX which can answer the queries like the above SQL.