FME Transformers: 2024.2

Categories
Database
Strings
Related Transformers
AttributeFilter
NullAttributeMapper

AttributeValueMapper

Compares attribute values to a lookup table and assigns new values where matches are found. Mapped values may be stored in a new attribute, or overwrite an existing attribute, including the original source.

Jump to Configuration

Typical Uses

  • Adding or altering attribute values based on a user-defined lookup table
  • Cleaning up attribute values
  • Creating alternative, coded values for attributes

How does it work?

The AttributeValueMapper is driven by a user-defined lookup table - the Value Map. One Input Attribute is selected, which will have its values compared to the lookup table to map new values. The new values may be stored in a new attribute (default behavior), or can overwrite an existing attribute (including the Input Attribute).

The Value Map can either be created manually or by importing any FME-supported dataset. Importing is particularly useful for using a predefined map that already contains the Input and Output Values (such as a spreadsheet), and for scanning a dataset to find all existing values for a given attribute.

If an attribute value is not found in the Value Map, the new attribute will be assigned the Default Output Value, which may be left blank.

Additional Value Settings

Default Output Value, Input Value, and Output Value can be set to a fixed value, or can use an FME predefined value. In the case of Input and Output values, these may be set per line in the Value Map table, and so different attribute values may prompt different actions.

Values available are:

Null

Input Value: Input null values will be mapped to a output value.

Output Value: The source value will be mapped to a null output value.

The reverse is true if Mapping Direction is set to Reverse (Output to Input).

No Action

No action will be taken. When mapping in-place (that is, if the new value is overwriting the input value), the input attribute value will be preserved.

Otherwise, no output attribute will be created for the input value specified.

Support for Null, Missing, and Empty String Values

When mapping from input to output, there are three attribute values that are not supported by the Default Output Value parameter or the Value Map table. They are: missing, null, and empty string values. The exceptions are noted below.

It is possible to map or specify a default value of null by using the null constant, available on the parameter drop-down menu.

Further, it is possible to map a source value to a destination value of empty string, or to specify the empty string as the default value.

Note that if a missing or null value is specified as a destination value or default value via an attribute, it will be converted into an empty string.

Examples

Usage Notes

  • if you need to map to or from null, missing, or empty string values, consider using NullAttributeMapper.

Configuration

Input Ports

Output Ports

Parameters

Editing Transformer Parameters

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.

For more information, see Transformer Parameter Menu Options.

Reference

Processing Behavior

Feature-Based

Feature Holding

No

Dependencies None
Aliases ValueMapper
History Previously named ValueMapper

FME Community

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 AttributeValueMapper 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.