Hi,
I tried to get last 52 weeks from the current period for LY sales.
We have fiscal date hierarchy (year - quarter - month -week) .
In scripts,
Paralleldate ( [date].[hierarchy].[year number], 1 , [date].[hierarchy].currentmember )
this works fine.
but
Scope([Date].[FISCAL YEAR NUMBER].members, [Date].[FISCAL MONTH NAME].members ,[Date].[FISCAL WEEK HISTORICAL NUMBER].members, [Date].[DATE KEY].members);
-- PRIOR YEAR CALCULATIONS
([Time Calculations].[Prior Year]=
(ParallelPeriod([Date].[Hierarchy].[Date].[Hierarchy].[FISCAL WEEK HISTORICAL NUMBER],52,
[Date].[Hierarchy].CurrentMember)
,[Time Calculations].&[ Current Period])
);
End Scope;
) ,
then it doesn't work. I don't know why. ( I can deploy the cube but when I browse the cube, it gives an error without any detailed info. )
FYI, we have fiscal week in historical number ( 52 weeks in fiscal yr) in date table.
then it doesn't work. I don't know why.
Please give me any comments.A couple of clarifications:
- What is the purpose of this scope statement:
Scope([Date].[FISCAL YEAR NUMBER].members, [Date].[FISCAL MONTH NAME].members ,[Date].[FISCAL WEEK HISTORICAL NUMBER].members, [Date].[DATE KEY].members);
- Why is this assignment enclosed in parentheses:
([Time Calculations].[Prior Year]=
(ParallelPeriod([Date].[Hierarchy].[Date].[Hierarchy].[FISCAL WEEK HISTORICAL NUMBER],52,
[Date].[Hierarchy].CurrentMember)
,[Time Calculations].&[ Current Period])
);
|||Sorry for the late response.
Now, we've just found some problems with perivios one, Due to the Hierarhcy attribute ( fiscal week key) we can't get last 52 weeks in time calculation called shell dimension.
But,
If I use time intelligence calculation wizard and change some for the prior year calcuation then the formula works fine only in week level .(please refer script as below)
I can't see values in year , quarter, and month levels ( these show 0 value), and in day level I can see the values but values are wrong.
To solve this problem and to view prior year value in all levels( y- q- m -w- day) , how can I approach ?
It seems this formula only works for week level values.
Thank you in advance and please give me any comments.
--Scripts for prior year--
(
[Date].[Fiscal Hierarchy Date Calculations].[Prior Year],
[Date].[FISCAL WEEK HISTORICAL NUMBER].[FISCAL WEEK HISTORICAL NUMBER].Members,
[Date].[Tbl DIM Date].Members
) =
Aggregate(
{ [Date].[Fiscal Hierarchy Date Calculations].DefaultMember } *
{
ParallelPeriod(
[Date].[Fiscal Hierarchy].[FISCAL WEEK],
52,
[Date].[Fiscal Hierarchy].CurrentMember
) : [Date].[Fiscal Hierarchy].CurrentMember
})
- Aggregate(
{ [Date].[Fiscal Hierarchy Date Calculations].DefaultMember } *
{
ParallelPeriod(
[Date].[Fiscal Hierarchy].[FISCAL WEEK],
51,
[Date].[Fiscal Hierarchy].CurrentMember
) : [Date].[Fiscal Hierarchy].CurrentMember
}
);
sql
No comments:
Post a Comment