Slow running COUNT CROSSJOIN query -
05-02-2005
, 07:35 PM
I was wondering if anybody had any suggestions about speeding up a
COUNT CROSSJOIN calculated member.
I'm trying to retrieve a Distinct Count on a Distinct Count Measure
([Measures].[Member Id]) and I'm slicing by multiple dimensions and the
query is taking forever (> 3:00 minutes). I was thinking of you using
NONEMPTYCROSSJOIN() but couldn't get the same results. Any other
suggestions would be helpful too.
Here's the calculated member crossjoining distinct count
[Measures].[Member Id] with the Member dimension:
MEMBER [Measures].[Distinct Count Member] AS 'Count(CrossJoin(
{[Measures].[Member Id]}, Descendants([Member].CurrentMember,
[Member].[Member Id])), ExcludeEmpty)', SOLVE_ORDER = 0
Full Query:
--SUM all members that had a claim between 01/01/2004 - 03/31/2004
WITH MEMBER [ClaimsIncurredDate].[All ClaimsIncurredDate].[Aggregation]
AS ' SUM(
{[ClaimsIncurredDate].[Year].&[2004].&[1].&[01].&[20040101]:[ClaimsIncurredDate].[Year].&[2004].&[1].&[01].&[20040131],
[ClaimsIncurredDate].[Year].&[2004].&[1].&[02],
[ClaimsIncurredDate].[Year].&[2004].&[1].&[03].&[20040301]:[ClaimsIncurredDate].[Year].&[2004].&[1].&[03].&[20040331]}
) ', SOLVE_ORDER = 0
--SUM all members that are under 17 based on 03/31/2004
MEMBER [DateOfBirth].[All DateOfBirth].[Aggregation] AS ' SUM(
{[DateOfBirth].[Year].&[1986].&[2].&[04]:[DateOfBirth].[Year].&[1986].&[4].&[12],[DateOfBirth].[Year].&[1987]:[DateOfBirth].[Year].&[2004],[DateOfBirth].[Year].&[2005].&[1].&[01]:[DateOfBirth].[Year].&[2005].&[2].&[05]}
) ', SOLVE_ORDER = 0
--CROSSJOIN against Distinct Count measure Member Id and the Member
dimension
MEMBER [Measures].[Distinct Count Member] AS 'Count(CrossJoin(
{[Measures].[Member Id]}, Descendants([Member].CurrentMember,
[Member].[Member Id])), ExcludeEmpty)', SOLVE_ORDER = 0
SELECT
{ [Measures].[Distinct Count Member] } ON COLUMNS ,
{ [Age].[All Age] } ON ROWS
FROM [GWClaims]
WHERE ( [DateOfBirth].[All DateOfBirth].[Aggregation],
[ClaimsIncurredDate].[All ClaimsIncurredDate].[Aggregation] ) |