Register Function Libraries Dialog Box

Analysis Services

Analysis Services

Register Function Libraries Dialog Box

Use this dialog box to register function libraries of other products or user-defined function libraries.

You can create user-defined functions to provide functions not in the Microsoft® SQL Server™ 2000 Analysis Services function library. A user-defined function can be developed on any tool capable of generating Microsoft ActiveX® libraries.

You can register user-defined function libraries of the following types:

  • Type libraries (*.olb, *.tlb, *.dll)

  • Executable files (*.exe, *.dll)

  • ActiveX controls (*.ocx)

The Analysis Services functions always take precedence over registered function libraries when function name conflicts occur (that is, two libraries contain the same function name). Except Analysis Services functions, the order of the libraries in the list is important. It defines the precedence of function resolution in cases of name conflicts. The first library takes precedence.

Analysis Services automatically registers the Microsoft Visual Basic® for Applications Expression Services function library (VBA332.dll) and the library that supports the Microsoft Excel worksheet functions. However, the Excel library must be installed separately from Analysis Services. For more information, including lists of supported functions, see Visual Basic for Applications Functions and Excel Functions.

This dialog box appears when you click Register in Calculated Member Builder or MDX Builder. After libraries are registered, the program IDs of the libraries appear in the Functions box of Calculated Member Builder or MDX Builder. You can return to the Register Function Libraries dialog box and add or remove other libraries.

Note  Functions are supported only if they accept as arguments only string or numeric data types, or array or variant data types containing string or numeric values. In addition, functions are supported only if they return only string or numeric data types, or variant data types containing numeric values.

Options

Add

Click to locate and select the library file you want to register. The program IDs associated with the function library appear in the list box.

Remove

Click to remove a selected program ID from the selection to be registered.

Close

Click to complete registration when you are satisfied that the correct programs in external function libraries are contained in the list box.

Calling a User-Defined Function within MDX

After a user-defined function is registered in the Register Function Libraries dialog box, it can be used anywhere in the Multidimensional Expressions (MDX) syntax that allows expressions, for example:

With Member Measures.[Forecasted Sales] As
     'Sales * ForecastedGrowthRate(SaleReps.CurrentMember.Name)'
Select TopCount(SalesReps, HowManyReps(), Sales) on Rows,
     {Sales, [Forecasted Sales] } on Columns
From Sales

The HowManyReps and ForecastedGrowthRate user-defined functions are defined as:

Public Function HowManyReps() as Integer
Public Function ForecastedGrowthRate(RepName as String) as Double

Note  There may be multiple user-defined functions residing in the same ActiveX library.