Mathematical function
With the Mathematical function component, various mathematical calculations can be performed.
Input values serve as the basis for the calculations. The input values can be numerical values or model objects. If model objects are used as input values, then suitable attributes must be configured as numerical values (numbers, date) for the model objects. These attributes provide the input values of the mathematical function.
Functions and operators:
All functions that can be created under the Function attribute can be created as functions and operators.
Result calculation:
The result is calculated from one input value (x-attribute) or from two input values (x-attribute and y-attribute).
Input values:
Model objects or numerical values (e.g. numbers, date) are permitted as input values. If model objects are used as input values, additional suitable attributes must be configured which provide the actual values (e.g. numbers, date) for the operations.
Operators can be used for the calculations. These operators are
-
simple mathematical operators (e.g."=")
-
Mathematical functions, as known from MS Excel
Operators for multiple values within a dimension:
If several values are supplied for an attribute, a suitable additional operator is used depending on the function.
Configuration:
Property | Description |
---|---|
Logic operation (objects) |
If the condition is executed on multiple objects, you can use the Logical operation(Objects) property to determine how the results of the condition (true or false) are linked and evaluated:
|
x | Configure a query here that returns the first input value of the function or a model object. If a model object is returned here, a number attribute must be referenced in the x-attribute(e) property that returns the first input value of the function. |
Function | Select here a function or an operator for the calculation of the function. |
x-attribute(s) | Reference here one or more attributes that return the first input values of the function. |
y | Configure a query here that returns the second input value of the function or a model object. If a model object is returned here, a number attribute must be referenced in the y-attribute(e) property that returns the second input value of the function. |
y-attribute(s) | Reference here one or more attributes that return the second input values of the function. |
Constant / Final operation (formula) |
Define here either:
|
Variables |
You can activate the enabled attributes of a query and condition in the Variables property so that they can be changed by users at the time of execution. See also: Chapter Variables. |
Example: Function '-':
Here, all values of the X or Y dimension are first summed to an X and Y operand.
Then X-Y is executed.
(x1+x2+...+xn)- (y1+y2+...+ym)=X-Y= RESULT
Example: AVERAGE function:
There is no distinction between X and Y. Also only X values must be supplied.
(x1+x2+…+xn + y1+y2+…+ym)/(n+m)= RESULT
Example:
COS(PI())
Here the functions cosine and PI are used in Excel notation. No calculated input value is inserted. The result of the component is always -1.0. Any constants can also be used in this form.
Example:
COS ($source)
$source is replaced in the first step by the value calculated in the component.
For example, if this is 3.14, the formula would first become C0S(3.14) via the velocity macro. This in turn would be evaluated to -0.99999 in the second step.