ListSorter

Sorts the elements of the given list. The sorting can either be alphabetic or numeric, and in either ascending or descending order.

Null, missing, and empty values are considered to be the 'lowest' elements in both numeric and alphabetic sorting.

Examples

If an input feature had these attributes:

somelist{0} = 3

somelist{1} = 17

somelist{2} = 4

somelist{3} = 9

somelist{4} = 2

and the list name is set to somelist{}, then the feature leaving the transformer will have these attributes:

somelist{0} = 2

somelist{1} = 3

somelist{2} = 4

somelist{3} = 9

somelist{4} = 17

Note that if there were other attributes in the list "parallel" to the attribute being operated on, these will also be moved in the list to stay in "parallel" with the key attribute.

For example, if the input feature had these attributes:

somelist{0}.kind = 'paved'

somelist{0}.count = 3

somelist{1}.kind = 'smooth'

somelist{1}.count = 17

somelist{2}.kind = 'trail'

somelist{2}.count = 4

somelist{3}.kind = 'rough'

somelist{3}.count = 9

somelist{4}.kind = 'logging'

somelist{4}.count = 2

and the list name is set to somelist{}.count, then the feature leaving the transformer will have these attributes:

somelist{0}.kind = 'logging'

somelist{0}.count = 2

somelist{1}.kind = 'paved'

somelist{1}.count = 3

somelist{2}.kind = 'trail'

somelist{2}.count = 4

somelist{3}.kind = 'rough'

somelist{3}.count = 9

somelist{4}.kind = 'smooth'

somelist{4}.count = 17

Lastly, if the original list was sparse, that is, it was missing some elements, the sorting operation will have the side effect of compacting the list to make all elements have consecutive indices. For example, if the input feature had these attributes:

somelist{0}.kind = 'paved'

somelist{0}.count = 3

somelist{3}.kind = 'rough'

somelist{3}.count = 9

somelist{4}.kind = 'logging'

somelist{4}.count = 2

and the list name is set to somelist{}.count, then the feature leaving the transformer will have these attributes:

somelist{0}.kind = 'logging'

somelist{0}.count = 2

somelist{1}.kind = 'paved'

somelist{1}.count = 3

somelist{2}.kind = 'rough'

somelist{2}.count = 9

Configuration

Input Ports

Output Ports

Parameters

Additional Resources

More Information on Lists

Editing Transformer Parameters

Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.

Defining Values

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. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.

Dialog Options - Tables

Transformers with table-style parameters have additional tools for populating and manipulating values.

FME Community

The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.

Search for all results about the ListSorter on the FME Community.