Hello
I have a MDX query which uses by one of our reports.
The query calculates current year and previous year YTD values.
the [YTD Prev Year Unique Product Submissions] based on the Fiscal Day.
The problem is previous year calculation of the Feb 29. Because there is no Feb 29 previous year. (Please see the attachment)
any help will be appreciated.
Here is the query
WITH SET [TimeSet1] AS
GENERATE(
{
PARALLELPERIOD([Time].[Y-Q-M-D Fiscal].[Fiscal Month], 14, STRTOMEMBER("[Time].[Y-Q-M-D Fiscal].[Fiscal Month].&[2016]&[4]"))
:
PARALLELPERIOD([Time].[Y-Q-M-D Fiscal].[Fiscal Month], 1, STRTOMEMBER("[Time].[Y-Q-M-D Fiscal].[Fiscal Month].&[2016]&[4]"))
}
, {[Time].[Y-Q-M-D Fiscal].LastChild}
)
SET [TimeSet2] AS
UNION (
[TimeSet1],
STRTOMEMBER("[Time].[Y-Q-M-D Fiscal].[Fiscal Month].&[2016]&[4]").LASTCHILD
)
MEMBER [MonthName] AS [Time].[Y-Q-M-D Fiscal].CurrentMember.Parent.Properties ("MEMBER_NAME")
SELECT
{
[MonthName],
[Measures].[YTD Unique Product Submissions],
[Measures].[YTD Prev Year Unique Product Submissions],
[Measures].[YoY Unique Product Submissions]
} ON COLUMNS,
{
STRTOSET("[Product Hierarchy].[Product Line].&[PRS]",CONSTRAINED) * [TimeSet2]
} ON ROWS
FROM [MY_Cube]
I have a MDX query which uses by one of our reports.
The query calculates current year and previous year YTD values.
the [YTD Prev Year Unique Product Submissions] based on the Fiscal Day.
The problem is previous year calculation of the Feb 29. Because there is no Feb 29 previous year. (Please see the attachment)
any help will be appreciated.
Here is the query
WITH SET [TimeSet1] AS
GENERATE(
{
PARALLELPERIOD([Time].[Y-Q-M-D Fiscal].[Fiscal Month], 14, STRTOMEMBER("[Time].[Y-Q-M-D Fiscal].[Fiscal Month].&[2016]&[4]"))
:
PARALLELPERIOD([Time].[Y-Q-M-D Fiscal].[Fiscal Month], 1, STRTOMEMBER("[Time].[Y-Q-M-D Fiscal].[Fiscal Month].&[2016]&[4]"))
}
, {[Time].[Y-Q-M-D Fiscal].LastChild}
)
SET [TimeSet2] AS
UNION (
[TimeSet1],
STRTOMEMBER("[Time].[Y-Q-M-D Fiscal].[Fiscal Month].&[2016]&[4]").LASTCHILD
)
MEMBER [MonthName] AS [Time].[Y-Q-M-D Fiscal].CurrentMember.Parent.Properties ("MEMBER_NAME")
SELECT
{
[MonthName],
[Measures].[YTD Unique Product Submissions],
[Measures].[YTD Prev Year Unique Product Submissions],
[Measures].[YoY Unique Product Submissions]
} ON COLUMNS,
{
STRTOSET("[Product Hierarchy].[Product Line].&[PRS]",CONSTRAINED) * [TimeSet2]
} ON ROWS
FROM [MY_Cube]