Weeks Hierarchy Performance vs Normal Time Hiearchy -
11-09-2006
, 01:23 PM
I have got two hierarchies in my Time dimension. The first is a standard
hierarchy consisting of Year -> Quarter -> Month -> Date and the second is a
reporting weeks hierarchy consisting of Reporting Year -> Reporting Week ->
Date. Most of the queries we run pull time related totals (Current Week,
MTD, QTD, and YTD and Current Week vs Prior, MTD vs. Prior MTD, QTD vs. Prior
QTD, and YTD vs. Prior YTD).
These MDX queries run extremely fast when using the standard time hierarchy
at the Month, Quarter, or Year level. However, at the Reporting Week or Date
level, the queries run MUCH slower. I've established attribute hierarchies
appropriately in the time dimension. Below are the cube calculations that
are used (only showing YTD calcs below but others are the same just MTD or
QTD). Is there a better / faster way to create these cals?
CREATE MEMBER CURRENTCUBE.[MEASURES].[YTD Mkt Loan Cnt]
AS sum(YTD(IIF([Time].[Standard].CurrentMember.level is
[Time].[Standard].[ALL].level,
LinkMember(ClosingPeriod([Time].[Weeks].[PK_Date],[Time].[Weeks].Currentmember),[Time].[Standard]),
[Time].[Standard].currentmember)),sum([Lender].[Lender].[All],[Measures].[Loan Count])),
FORMAT_STRING = "#,#",
NON_EMPTY_BEHAVIOR = [Loan Count],
VISIBLE = 1;
CREATE MEMBER CURRENTCUBE.[MEASURES].[YTD Loan Count AL PP]
AS sum(YTD(ParallelPeriod([Time].[Standard].[Year],1,case when
[Time].[Standard].CurrentMember.level is [Time].[Standard].[ALL].level then
LinkMember(ClosingPeriod([Time].[Weeks].[PK_Date],[Time].[Weeks].Currentmember),[Time].[Standard])
else [Time].[Standard].currentmember end))
,sum([Lender].[Lender].[All],[Measures].[Loan Count])),
FORMAT_STRING = "#,#",
NON_EMPTY_BEHAVIOR = [Loan Count],
VISIBLE = 1;
CREATE MEMBER CURRENTCUBE.[MEASURES].[YTD Lender Loan Cnt]
AS sum(YTD(IIF([Time].[Standard].CurrentMember.level is
[Time].[Standard].[ALL].level,
LinkMember(ClosingPeriod([Time].[Weeks].[PK_Date],[Time].[Weeks].Currentmember),[Time].[Standard]),
[Time].[Standard].currentmember)),[Measures].[Loan Count]),
FORMAT_STRING = "#,#",
NON_EMPTY_BEHAVIOR = [Loan Count],
VISIBLE = 1;
CREATE MEMBER CURRENTCUBE.[MEASURES].[YTD Loan Count CL PP]
AS sum(YTD(ParallelPeriod([Time].[Standard].[Year],1,case when
[Time].[Standard].CurrentMember.level is [Time].[Standard].[ALL].level then
LinkMember(ClosingPeriod([Time].[Weeks].[PK_Date],[Time].[Weeks].Currentmember),[Time].[Standard])
else [Time].[Standard].currentmember end))
,[Measures].[Loan Count]),
FORMAT_STRING = "#,#",
NON_EMPTY_BEHAVIOR = [Loan Count],
VISIBLE = 1;
I have tried defining aggregations a hundred or so times and can't seem to
get any good performance bump. I've had usage logging on for 3 months and
have tried usage based optimizations as well with no luck.
Any help would be greatly appreciated!
Best regards,
Shaun
--
Shaun A. Richardson |