dbTalk Databases Forums  

How to apply a formula to all the dimension members ??

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss How to apply a formula to all the dimension members ?? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
agarwalshuchi@gmail.com
 
Posts: n/a

Default How to apply a formula to all the dimension members ?? - 03-04-2006 , 10:23 PM






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 How do i do this ??

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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.