Reputation: 197
I have a fact table with structure: (objectid, fromLoc, toLoc, duration).
I need the equivalent MDX for the following SQL:
select fromLoc, toLoc, max(duration) from fact group by fromLoc, toLoc;
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:
WITH
MEMBER [Measures].[MaxValue] AS
max([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.
Upvotes: 1
Views: 1058