I am facing an issue that looks trivial to me but that cannot solve for days now... My cube has mainly one DimDate dimension (to simplify my issue): in the dim date, I have two hierarchies: one standard (Time) that decompose the date in Date, Month, Quarter and Year One (Trimester Time) that decompose the date in Date, Month, Trimester (one third of a year) and Year. on my fact table I have for each day a purchase Orders (PO) and a measure integer (0 or 1) that indicate that the PO is active. When browsing on each date I am able to see how much PO are active (Sum).
As you can expect, when I am looking at the figures for the month... I have the sum for each day... which is obviously not what I am expecting. I am trying to find that number that where open on the very last day of that period.
I then created several attributes to the dimDate: Is Last Day Of Calendar Qtr Is Last Day Of Calendar Trimester Is Last Day Of Calendar Month Is Last Day Of Calendar Year
Then I created a new calculated member that is like that:
CREATE MEMBER CURRENTCUBE.[Measures].[MyMeasures]
AS CASE
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[CalendarYear] then
([Measures].[Active],[Dim Date].[Is Last Day Of Month].&[Y],[Dim Date].[Month Of Year].&[12])
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[CalendarQtr] then
([Measures].[Active],[Dim Date].[Is Last Day Of Calendar Qtr].&[Y])
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[CalendarMonth] then
([Measures].[Active],[Dim Date].[Is Last Day Of Month].&[Y])
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[Date] then
[Measures].[Active]
ELSE NULL
END,
VISIBLE = 1 , DISPLAY_FOLDER = 'Duration';
this was working fine up until I got requested to extend the measure for both hierarchies. I then did update the member with the following:
CREATE MEMBER CURRENTCUBE.[Measures].[MyMeasures]
AS CASE
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[CalendarYear] then
([Measures].[Active],[Dim Date].[Is Last Day Of Month].&[Y],[Dim Date].[Month Of Year].&[12])
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[CalendarQtr] then
([Measures].[Active],[Dim Date].[Is Last Day Of Calendar Qtr].&[Y])
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[CalendarMonth] then
([Measures].[Active],[Dim Date].[Is Last Day Of Month].&[Y])
WHEN [Dim Date].[Time].currentMember.Level is [Dim Date].[Time].[Date] then
[Measures].[Active]
WHEN [Dim Date].[Time Trimester].currentMember.Level is [Dim Date].[Time Trimester].[CalendarYear] then
([Measures].[Active],[Dim Date].[Is Last Day Of Month].&[Y],[Dim Date].[Month Of Year].&[12])
WHEN [Dim Date].[Time Trimester].currentMember.Level is [Dim Date].[Time Trimester].[Calendar Year Trimester] then
([Measures].[Active],[Dim Date].[Is Last Day Of Calendar Trimester].&[Y])
WHEN [Dim Date].[Time Trimester].currentMember.Level is [Dim Date].[Time Trimester].[CalendarMonth] then
([Measures].[Active],[Dim Date].[Is Last Day Of Month].&[Y])
WHEN [Dim Date].[Time Trimester].currentMember.Level is [Dim Date].[Time Trimester].[Date] then
[Measures].[Active]
ELSE NULL
END,
VISIBLE = 1 , DISPLAY_FOLDER = 'Duration';
their must be something that is conceptualy wrong in my though process, but I cannot get it... can someone help me?
as a result I get the bellow results in Excel:
with the time hierarchy, it works fine
with the trimester hierarchy, it shows only 3rd trimester...