In this article:
Inserting User Functions and Methods
Example of Inserting Functions and Operators into Expression
Functions and operators can be inserted by means of the functions panel or entered from keyboard.
Available functions and operators depend on the object, for which an expression is created.
To get a brief description of function or operator, select it on the functions panel. The description is displayed at the bottom of the panel. The desktop application enables the user to get a link to a full description of function or operator. To do this, click the Full Description link located at the end of the brief description.
TIP. If it is required to view description of function or operator used in the expression, open the context menu and select the Description item to view brief description on the data panel, or the Help item to view the help for the selected function or operator. The option is available only in the desktop application.
System functions are available in the expression editor right after Prognoz Platform 9 installation.
NOTE. If there is no calendar dimension in the data source, functions that use calendar dimension cannot be used in the expression editor. If there are several calendar dimensions in the data source, the dimension is used, for which the Timeline type is specified.
To insert system function:
Select the Functions radio button on the functions panel. All available functions are displayed. For example:
Select the function in the list or find it by means of search.
Click the Insert into Formula button or double-click the function or drag the function to the expression area.
The function is inserted into the expression area to the cursor position. Brackets for entering function parameter values are inserted at the same time. If there are several parameters, they are separated with a comma. For example, the SubTotal function looks as follows right after it is inserted into the expression area:
SubTotal(, , )
Enter function parameter values one by one.
The desktop application can display a tooltip for the current parameter, and a tooltip with available parameter values. To do this, put the cursor to the required parameter and press CTRL+SPACE. All available tooltips are displayed, for example:
The tooltip for the current parameter is displayed at the top, the tooltip with available parameter values is displayed at the bottom. The following can be used as parameter values:
Enumeration values.
Operands.
Functions.
Data source parameters.
As a result, the function is inserted into the expression, for example:
SubTotal({Coal mining[t]},null ,PivotTotalPosition.Columns)
TIP. If name of the function to be used is known, it can be entered from keyboard. A tooltip with parameters and function parameter values is automatically displayed in the desktop application.
User functions and methods can be used to enhance expression capabilities due to the use of custom calculation methods. The functions to be used must be written in the Fore or Fore.NET language, must have the Public identifier, and must be saved in the current repository.
To insert user function:
In the expression area, put the cursor to the position where the user function must be located.
Enter the full path to the function. Path format is different depending on the function type:
User Fore function:
<Unit identifier>.<Function name>
User Fore.NET function:
<Fore.NET assembly identifier>.[<Namespace>].<Class name>.<Function name>
If name space is not determined, the .NET assembly name space is used by default.
If an application function contains parameters, enter them in parentheses right after the full path to the function.
As a result, the application function is inserted into the expression, for example:
CALCFUNC.UserCalculation({Number of companies[t]}, 100)
TIP. If it is required that your application function is displayed in the list of system functions, connect it on the functions panel into the User Functions special category. Such functions are inserted identically to system functions. For details see the Connecting User Functions to Expression Editor section.
Operators are used to mark operations executed with operands.
To insert operator:
In the expression area put the cursor to the position where the operator must be placed.
Enter the operator using keyboard or select the Operators radio button on the functions panel. All available operators are displayed. For example:
Select operator in the list or find it by means of search.
Click the Insert into Formula button or double-click the operator or drag it to the expression area.
As a result, the operator is inserted into the expression area.
The example is used to create an expression by means of functions and operators. Indicator's annual values in roubles and US dollar rate are used to calculate indicator value in US dollars and is interpolated to the semi-annual frequency:
See also: