span8
span4
span8
span4
This article describes the transformers available in FME that can be used to transpose a table (also known as a table rotation);a common operation performed in spreadsheet applications such as Excel.
Transposing a table involves switching the columns of a table into rows – in most cases without any data manipulation or summarization.For example:
In FME,a combination of the AttributeExploder and the Aggregator transformers allows you to transpose tables.The AttributeExploder transformer takes the attribute values on a row and creates a separate feature for each attribute – as a name/value pair.By aggregating these features back together you can recombine the columns of the table as rows.
This article will demonstrate how to perform a transpose on data that is formatted as below:
The following workspace can be used to perform a transpose on an Excel table:
The key transformers for the workspace include:
The name/value pair represents the column or attribute name (_attr_name) and the attribute or cell value (_attr_value).
The output of the aggregator is a new feature for each column in the initial table with a list attribute that contains the various cell values.
The easiest approach to output this list to an MS Excel format is to use an AttributeCreator or AttributeRenamer to rename to column letters;A,B,C,etc.See the example workspace and accompanying video for the method used to implement this approach.
The use of an AttributeExploder can often scramble the order of the attributes,and create issues when writing the output rows to a specific order.A Sorter transformer can be used to overcome this limitation and sequence the rotated table's rows.The end result is a transpose of the original table.
Using a Template File when Writing Excel Data
How to Convert CSV to Microsoft Excel
Viewing and Inspecting Excel Data
Example scripts for deleting Excel files prior to writing (FME 2013 SP1 and earlier)
Overview of Excel Reader Parameters
Overview of Excel Writer Parameters
Tutorial: Getting Started with Excel
How to Convert CSV to Shapefile (Non-spatial to Spatial)
Advanced manipulation of Excel tables using AttributeExploder
© 2019 亚搏在线Safe Software Inc |Legal