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.
Author |
Topic |
shagarwal
Starting Member
5 Posts |
Posted - 2006-03-04 : 23:13:19
|
I have 2 dimensions Loans and Indicatordate in my database. Loan--Loan IDIndicatorDate--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 followsSelect {[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 1from LoansPlease help on this. |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-03-05 : 11:07:13
|
Dupe:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=62725 |
|
|
|
|
|