dbTalk Databases Forums  

Creating Custom Function @ MDX Level (SQL 2K)

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


Discuss Creating Custom Function @ MDX Level (SQL 2K) in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ravi
 
Posts: n/a

Default Creating Custom Function @ MDX Level (SQL 2K) - 04-07-2006 , 09:57 AM






Greetings,

I am writing a MDX Query and use ColasceEmpty function for atleast 15-20
Mesures

example for one such measure :

-----PAR Value As on Report To Date
MEMBER
[Measures].[PARValue] as '([Measures].[PAR Value],
ClosingPeriod ([Transaction Dates].[Day], [Transaction
Dates].CurrentMember))'

-----PAR Value As on Report To Date (Recursion if data for Report To Date Do
not exist)
MEMBER
[Measures].[Relative Total Records in PAR] as ' CoalesceEmpty(
([Measures].[PARValue], [Transaction Dates].CurrentMember),
([Measures].[Relative Total Records in PAR], [Transaction
Dates].currentmember.prevmember))'

Is there a way I can avoid repetion of this block of code multiple times by
creating a custom function which in turn will call ColasceEmpty (basically a
wrapper function) :
and I will pass a couple of parameters like : New Measure Name , Measure.

Please advise


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.