Skip to main content
Question

How to transform wide table with multi level nested columns and multi-rows into a longer format?


smfks911

 I have attached an excel spreedsheet. I would like to merge and convert the table in sheet 1 ("Year_2035') and sheet 2 ('Year_2050') into a table structure like that one in 'RequiredFormat' sheet. I have never transformed such a complex data structure in FME before. Can anyone kindly help with good suggestions?

2 replies

debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • December 14, 2022

Hello @smfks911​ 

It sounds like you want to transpose the Excel data. It looks like the inpu t Excel sheets are fixed forms. If they are fixed, you should be able to use a modified version of Example 2 workflow in the transpose article linked above where an AttributeExploder is used to explode only columns containing data (eg. columns C-F) in your sample dataset.

Once these data features have been exploded, you can add attribute values based on the original column name. For example, data from column C would contain the following attributes and values: DevelopmentType=All, Ownership Type=Private,Land Type=Open space.

I have attached a sample workspace demonstrating this workflow.


smfks911
  • Author
  • December 15, 2022
debbiatsafe wrote:

Hello @smfks911​ 

It sounds like you want to transpose the Excel data. It looks like the inpu t Excel sheets are fixed forms. If they are fixed, you should be able to use a modified version of Example 2 workflow in the transpose article linked above where an AttributeExploder is used to explode only columns containing data (eg. columns C-F) in your sample dataset.

Once these data features have been exploded, you can add attribute values based on the original column name. For example, data from column C would contain the following attributes and values: DevelopmentType=All, Ownership Type=Private,Land Type=Open space.

I have attached a sample workspace demonstrating this workflow.

Thank you @debbiatsafe​ for your reply and providing with a sample workspace. That is really useful to understand the workflow.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings