Connecting Custom Functions

Custom functions and methods can be used to enhance expression capabilities due to the use of custom calculation methods. Custom functions are available for use in:

Custom functions are not connected to the tools by default, and they should be entered manually in the expression each time to be used. Foresight Analytics Platform enables the user to connect custom functions to system functions in all tools defined above.

NOTE. Custom functions can be connected only in the desktop application.

For example, in the expression editor they are displayed on the functions panel in the Custom Functions category:

To connect custom functions, use the Methods tab in the Custom Metadata section of the Parameters dialog box. All methods added on this tab will be connected to the custom functions section in the Foresight Analytics Platform tools.

To open the Methods tab

The tab contains custom functions divided by folders. Folders are categories that are used to arrange and group functions. Custom functions grouped by categories are displayed in the Time Series Analysis and Modeling and Forecasting tools. In the expression editor and the Calculation Algorithms and Reports tools, custom functions are displayed without division on categories.

Requirements to custom functions:

Add a category

Add and set up a method

Edit method

Rename method or category

Set up method or category order

Remove method or category

Example of Custom Function Syntax

Functions and methods can be used as a custom function.

Custom method. Syntax:

Sub MyFunc(Factor1, Factor2: ITimeSeries; Var Output: ITimeSeries; Coef1: Double; Coef2: Double);
Begin
    ...
End Sub MyFunc;

Public Shared Sub MyFunc(Factor1, Factor2: ITimeSeries; Var Output: ITimeSeries; Coef1: Double; Coef2: Double);
Begin
    ...
End Sub;

Method parameters:

Custom function. Syntax:

Function MyFunc(Input, Input1: ITimeSeries; Coef: Double): ITimeSeries;
Var
    Output: ITimeSeries;
Begin
    ...
    
Return Output;
End Function MyFunc;

Public Shared Function MyFunc(Input, Input1: ITimeSeries; Coef: Double): ITimeSeries:
Var
    Output: ITimeSeries;
Begin
    ...
    
Return Output;
End Function;

Function parameters:

See also:

Creating Formulas and Expressions