August 28, 2015 at 5:42 pm
I am new one in MDX. Our PeriodsToDate function does not return any value. We have set type property of our Date Dimension as time.
Actually CURRENTMEMBER does not return a valid value. So our PeriodsToDate function fail.
Pl see query below that return nothing
With MEMBER [Measures].[YTD Actual]
AS
Aggregate
(
PeriodsToDate
(
[DimDate].[CalendarHierarchyDateLevel].[Calendar Year]
,[DimDate].[CalendarHierarchyDateLevel].CURRENTMEMBER
)
,[Measures].[Actual Sales Amount]
)
select {[Measures].[Actual Sales Amount], [Measures].[YTD Actual]} on 0 from [MyCube]
But When we give Year as Hardcoded then it return correct value.
with MEMBER [Measures].[YTD Actual]
AS
Aggregate
(
PeriodsToDate
(
[DimDate].[CalendarHierarchyDateLevel].[Calendar Year]
,[DimDate].[CalendarHierarchyDateLevel].[Calendar Year].&[2008]
)
,[Measures].[Actual Sales Amount]
)
select {[Measures].[Actual Sales Amount], [Measures].[YTD Actual]} on 0 from [MyCube]
Please help me to resolve this issue.
Thanks in advance.
August 31, 2015 at 9:16 am
From a quick look, it looks like the issue is the following:
You are not including the Date hierarchy on an axis in your query, and therefore the "CurrentMember" property will be at the "All" level. I bet that if you include the Date hierarchy on your axis (1), you will see some results.
I would also recommend that you use something like the "Descendants" function to step down to the correct level.
August 31, 2015 at 11:42 am
Thanks This help me.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply