![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
-----Original Message----- Data for 1st Quarter, 2nd Quarter is present but for the 3rd Quarter there is no record for the current month(August) but for there are records for July. I have used the following : CoalesceEmpty(([Measures].[Qty On Hand], ClosingPeriod( [AP Time].[Week]) ) ,([AP Time].CurrentMember.LastChild, [Measures].[Qty On Hand])) and even tried: Iif( IsEmpty(([Measures].[Qty On Hand],ClosingPeriod( [AP Time].[Week]) )), ([AP Time].CurrentMember.LastChild, [Measures].[Qty On Hand]), ([Measures].[Qty On Hand],ClosingPeriod( [AP Time]. [Week]) ) ) I am trying to get the value for July using : ([AP Time].CurrentMember.LastChild, [Measures].[Qty On Hand]) but since LastChild is August and data is not found it returns NULL. I was wondering if there is any MDX function that could get me the last value for July only. -- Posted via http://dbforums.com . |
#2
| |||
| |||
|
|
This example is from George Spofford's book MDX Solutions pg 68. I think it will get you on track. WITH MEMBER [Measures].[Last Qty On Hand] AS 'iif ( NOT IsEmpty ( [Measures].[Qty On Hand]), [Measures].[Qty On Hand], iif ( [Time].PrevMember IS NULL, NULL, ([Measures].[Last Qty On Hand], [Time].PrevMember) ) )' -----Original Message----- Data for 1st Quarter, 2nd Quarter is present but for the 3rd Quarter there is no record for the current month(August) but for there are records for July. I have used the following : CoalesceEmpty(([Measures].[Qty On Hand], ClosingPeriod( [AP Time].[Week]) ) ,([AP Time].CurrentMember.LastChild, [Measures].[Qty On Hand])) and even tried: Iif( IsEmpty(([Measures].[Qty On Hand],ClosingPeriod( [AP Time].[Week]) )), ([AP Time].CurrentMember.LastChild, [Measures].[Qty On Hand]), ([Measures].[Qty On Hand],ClosingPeriod( [AP Time]. [Week]) ) ) I am trying to get the value for July using : ([AP Time].CurrentMember.LastChild, [Measures].[Qty On Hand]) but since LastChild is August and data is not found it returns NULL. I was wondering if there is any MDX function that could get me the last value for July only. -- Posted via http://dbforums.com/http://dbforums.com . |
![]() |
| Thread Tools | |
| Display Modes | |
| |