Using MDX To Get The TopCount
Mar 27, 2007I am using a simple MDX to get the TopCount and it is working. The issue is that there are typos and miss spelled words in the primary attribute of my selection.
Therefore, I am trying to use a calculated member to get the intersection name (see code below). I am getting "#error" for the [Measures].[Intersection] in my results.
if I add the [Crash].[Intersection Streets].[Intersection Streets] in my topcount expression then I get the wrong topcount result (typo's).
Any ideas how to accomplish this.
Thanks,
with
Member [Measures].[Intersection] as
' [Crash].[Intersection Streets].[Intersection Streets].currentmember.uniquename'
select
{[Measures].[Crash Count],
[Measures].[Injury Crashes],
[Measures].[Fatal Crashes],
[Measures].[Fatalities],
[Measures].[Intersection]}
on columns,
Topcount( CrossJoin([Crash].[County].[County],
[Crash].[City].[City],
[Crash].[TS Crash Route].[TS Crash Route],
[Crash].[TS Crash Mile Station].[TS Crash Mile Station] ),
10, [Measures].[Crash Count])
on rows from
(select ([Crash].[County].[County],
[Crash].[City].[City],
[Crash].[TS Crash Route].[TS Crash Route],
[Crash].[Intersection Streets].[Intersection Streets],
[Crash].[TS Crash Mile Station].[TS Crash Mile Station])
on columns from [SDM_Reports]
where ([Crash].[City].&[Springfield]))
where ([Reportability].[Is Reportable].&[Yes],
[Crash].[Is Intersection].&[Yes],
[Crash].[Statistical Year].&[