Performs a mathematical calculation on an expression that consists of FME Feature Functions, String Functions, Math Functions, and Math Operators. The operands and function arguments consist of attributes on the input feature, constant literals, published and private parameters, as well as functions and operators.
You can use the GUI interface to set up an expression, but you can also edit an expression manually. The results of the expression are stored inside attributes specified by user.
There are two main uses for ExpressionEvaluator:
The supported operators are a subset of the operators permitted in C expressions. They have the same meaning and precedence as the corresponding C operators with one notable exception: they support numeric nulls.
Expressions are expected to yield numeric results. FME supports numeric nulls, which permit expressions to return null as result. For example, the expression 8.2 + 6 returns 14.2, whereas the expression @Value(nullAttr) * 1 returns null.
• fme_expression_warnings{}.attrName
• fme_expression_warnings{}.message
• fme_expression_warnings{}.transformerName
Inside the ExpressionEvaluator, null, missing, and empty string attributes are all considered to be null. Thus, @Value(attr) * 1 will result in null if attr is not present on the feature or is an empty string.
|
Evaluation Mode |
Choose Create New Attribute to evaluate the specified expression and have the calculated results put in the specified attribute. Choose Overwrite Existing Attributes to evaluate the specified expression once per selected attribute. The result of the evaluation will be put back into the attribute. |
||||
|
Attributes To Overwrite |
This parameter allows the same expression to be evaluated, once per selected attribute. For each attribute specified, the result of the expression will be stored into that attribute. If the expression needs the value of the current attribute, retrieve it using the function @CurrentAttribute(). For example, if the incoming feature has attributes X and Y, and we wish to increment each by one, select both attributes, and set the expression to @CurrentAttribute() + 1. This will set the attribute X to X+1 and Y to Y+1. Warning The order of evaluation is not guaranteed. If overwriting attr, @Value(attr) should not be used.
|
||||
|
Advanced: Attribute Value Handling |
|
|
Result |
Name the attribute to contain the result. |
An expression consists of a combination of operators and operands, functions and arguments, and parentheses. White spaces may be used between the operands, operators, and parentheses, and are ignored by the expression processor.
Operands and arguments may be specified in the following ways:
Numeric values may be specified in decimal, such as 123 or 12.3, in octal if the first two characters of the operand are 0o (zero followed by the letter o), or in hexadecimal if the first two characters of the operand are 0x.
Floating-point numbers may be specified in any of the ways accepted by an ANSI-compliant C compiler, except that "f", "F", "l", and "L" suffixes are not permitted. For example, all of the following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. If no numeric interpretation is possible, then an operand is considered to be null.
For more information on the elements of the editor GUI, see the Arithmetic Editor.
FME Feature Functions
For more information, see FME Feature Functions.
String Functions
For more information, see String Functions.
Math Functions
For more information, see Math Functions.
Math Operators
For more information, see Math Operators.
FME Support Center has a good example of the ExpressionEvaluator.
If you are setting more than one attribute, consider using the AttributeCreator, which contains the same functionality through the Arithmetic Editor.
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click
beside the applicable parameter.
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters.
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
| These functions manipulate and format strings. | |
|
Special Characters |
A set of control characters is available in the Text Editor. |
| Math functions are available in both editors. | |
| Date/Time Functions | Date and time functions are available in the Text Editor. |
| These operators are available in the Arithmetic Editor. | |
| These return primarily feature-specific values. | |
| FME and workspace-specific parameters may be used. | |
| Creating and Modifying User Parameters | Create your own editable parameters. |
Transformers with table-style parameters have additional tools for populating and manipulating values.
|
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
|
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
|
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
|
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
For more information, see Transformer Parameter Menu Options.
|
Processing Behavior |
|
|
Feature Holding |
No |
| Dependencies | None |
| Aliases | |
| History |
The FME Community has a wealth of FME knowledge with over 20,000 active members worldwide. Get help with FME, share knowledge, and connect with users globally.
Search for all results about the ExpressionEvaluator on the FME Community.
Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.