Working with List Attributes: ListHistogrammer

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

This article is part of the tutorial: Transformers for Working with List Attributes

Several FME transformers are specifically designed to work with list attributes, including ListHistogrammer. These can be used to create, manipulate, transform, and analyze lists. Lists are created in FME using a wide range of transformers; see "Creating Lists Using Transformers" for more details.

ListHistogrammer

Workspace examples: WorkingWithLists2020.fmwt and ListHistogrammer2020.fmwt

The ListHistogrammer builds a histogram of the values found in a list and returns these in a new list attribute. The new list will be sorted so that the value with the most occurrences will be first. Using this transformer with the data in the Working With Lists workspace, we can easily identify the park with the most trees and determine the number of each species represented within each park. As a bonus, you can specify your own histogram list name, making it possible to have multiple histograms on a single feature.

Here we’re counting the occurrence of each tree species within a single park using the ListHistogrammer:

WRKjq_miaYB-YqZUF6v41YxMZAmMSeW7KT4wwlwCePWC0IbOK7ppmrwajnZKmR8_j5sDEfpMgTP1h7jGFsnCQJ9Z6IHC_vUZ7kuuYdJR0h5t7sT191eYO9Ej4cljLnYEKGk6D74

In the ListHistogrammer workspace, the user needs to count the number of features of each type (zone) in a set of zoning data. This can be achieved by creating an artificial aggregate and a list of the source data, and subsequently running it through the ListHistogrammer.

The workspace actually goes one step further: it uses a custom transformer to convert the histogram into a set of attributes and values. It also demonstrates an interesting use of AttributeExposer to import values from the Zoning data, allowing all newly generated attributes to be exposed and inspected.

gotV2Q3zNFPXxr9gLsPmHmlPvoRWmgqJuDf_i8fti0EiQw1KMEtRvbw6SIgH4NZmJ4RXwxgkkBvAGanfmm71M0-LP2T9x8jdE2atCCwakfUTe0H6fMTDekw6_mlfXiwgHXoZDsU

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

 

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.