Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 How to apply an MDX function to all the Members???

Author  Topic 

shagarwal
Starting Member

5 Posts

Posted - 2006-03-04 : 23:13:12
I have 2 dimensions Loans and Indicatordate in my database.

Loan

--Loan ID

IndicatorDate

--Year

---Month

----Day



I have written a function that returns me nearest Date from my database in case the date specified by the user does not exists.

The function applies to only those Loans for which the Indicator date is same as the Date entered my the user. It does not apply to all the loan Ids.

I want this function to return Indicator dates against all the Loan Ids and in case for a partcular Loan ID the date entered by the user does not exists then then i should get the Nearest 'Previous' existing Date for that Loan ID.

I want to know how can i apply this function to all the members of the Loan dimension ??

I have used "Head", along with Not Exists and Count functions as follows

Select

{[Measures].[Arrear30to59]} on 0,
{Head (Filter (Descendants([LoansIndicatorDate].[All LoansIndicatorDate].children,3),NOT IsEmpty([LoansIndicatorDate].CurrentMember.Name="25" and [LoansIndicatorDate].Parent.Name="November" and [LoansIndicatorDate].parent.parent.Name="2005")),1).item(0)} on 1
from Loans

Please help on this.

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-03-05 : 01:29:08
cross post
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=62726
Go to Top of Page
   

- Advertisement -