I have an MDX calculation that is working fine except for one case.
It is getting a roll up for a week and it looks like this:
with
MEMBER [Measures].[WTD]
as AGGREGATE( [Date].[Date].CURRENTMEMBER.Parent.CHILDREN, [Measures].[Survey Count] )
SELECT
NON EMPTY
{
[Measures].[Survey Count],
[Measures].[WTD]
} ON COLUMNS,
NON EMPTY
{
( [Date].[Date].[Day].ALLMEMBERS )
} ON ROWS
FROM [myCube];
By week I mean Sunday to Saturday. This is the way the calculation is needed.
The problem is that when a Sunday to Saturday week has a change in month. So for the last Sunday to Saturday week in March 2017, for example, the second last day is March 31, and the last day is April 1. In the cube this looks like: week 13 has the March 26 - March 31 values (six days), and then week 13 appears again under the month of April. It is the first week under the month of April and that week 13 only has the one day - April 1. Then week 14 is next in April with a full 7 days (April 2 - April 8).
The cube has a Date hierarchy that has under it the Year, Quarter, Month, Week, and Day dimensions.
So how can I modify this MDX to include a full week (all seven days between Sunday to Saturday) when a week is split between two months?