I understand from your question that you want to have the bands as categories, which would mean you need them as members of some hierarchy. You can dynamically create members in MDX, but only for existing hierarchies. You did not state one, hence I just assume you have a hierarchy of events for which you want to seed cluster the duration, furthermore I assume the hierarchy containing the dimension key is named [Event].[Event Id]
. You also dis not state the name of the "average duration" measure. hence I just assume it is called Duration
.
Then you could use the following MDX:
WITH Member [Event].[Event Id].[< 1 year] AS
Aggregate(Filter([Event].[Event Id].[Event Id].Members,
[Measures].[Duration] < 1.0
)
)
Member [Event].[Event Id].[1-3 years] AS
Aggregate(Filter([Event].[Event Id].[Event Id].Members,
[Measures].[Duration] >= 1.0 AND [Measures].[Duration] < 3.0
)
)
Member [Event].[Event Id].[3-5 years] AS
Aggregate(Filter([Event].[Event Id].[Event Id].Members,
[Measures].[Duration] >= 3.0 AND [Measures].[Duration] < 5.0
)
)
Member [Event].[Event Id].[5+ years] AS
Aggregate(Filter([Event].[Event Id].[Event Id].Members,
[Measures].[Duration] >= 5.0
)
)
SELECT ... // whatever you want to see
ON COLUMNS,
{
[Event].[Event Id].[< 1 year],
[Event].[Event Id].[1-3 years],
[Event].[Event Id].[3-5 years],
[Event].[Event Id].[5+ years]
}
ON ROWS
FROM [YourCube]
Add WHERE conditions, other hierarchies to the rows or columns, subselects as you like.
I am not sure if this is really fast, but it solves the question.