dbTalk Databases Forums  

External Functions

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


Discuss External Functions in the microsoft.public.sqlserver.olap forum.



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

Default External Functions - 04-12-2004 , 10:49 PM






Hi All,

what are the procedure in writing an external method/function that can be
used in an MDX query.

thanks,



Reply With Quote
  #2  
Old   
JustinT
 
Posts: n/a

Default Re: External Functions - 04-13-2004 , 02:57 PM






You need to create a VB dll function that accepts a STRING parameter
and returns a STRING

Create a new calculated member in MSAS, notice the button "REGISTER"
in the window when creating the calc mbr. Your DLL should be compiled
and you need to ADD that DLL. The DLL will be associated with the
entire cube not just that calc mbr. I dont know why MS did this.

Your VB dll function should return a string that contains MDX and you
then have to use MSAS function "strtoset", or "strtomember" to convert
it so MSAS understands the string

--Calculated Mbr--
Name: CalcMbr1

strtoset(MyNewFunction("Time.1998")) <-- Your parameter needs to be a
string

** This will return a set, not a numeric value, you can do this in
order to see the set

settostr(strtoset(MyNewFunction("Time.1998")))

--VB--
Public Function MyNewFunction(ByVal sMember as string) As String
Dim sNewMember as string

sNewMember = sMember + ".children"


MyNewFunction = sNewMember
End FUnction



Hope this helps
Justin







"Maersa" <ma_ersa (AT) hotmail (DOT) com> wrote

Quote:
Hi All,

what are the procedure in writing an external method/function that can be
used in an MDX query.

thanks,

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.