Skip to main content
Solved

Simplifying a Table

  • September 4, 2017
  • 5 replies
  • 41 views

Forum|alt.badge.img+1

Hi folks I have this table:

and trying to simplify it so I can get to this:

Any help greatly appreciated.

Omar

Best answer by david_r

Here's one way to do it, I'm sure there are others:

  1. ListPopulator with prefix set to "Segment", list name as "SegmentID"
  2. ListExploder on list "SegmentID{}"

Send the attributes "ReportID" and "SegmentID" to your writer

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

david_r
Celebrity
  • 8394 replies
  • Best Answer
  • September 4, 2017

Here's one way to do it, I'm sure there are others:

  1. ListPopulator with prefix set to "Segment", list name as "SegmentID"
  2. ListExploder on list "SegmentID{}"

Send the attributes "ReportID" and "SegmentID" to your writer


fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • September 5, 2017

What is the source format? I'm a bit concerned that the reader will be a bit confused at having several columns with the same name. I checked and the CSV reader will add a suffix to duplicated column names so that is a way in. And then @david_r's technique works swimmingly.


david_r
Celebrity
  • 8394 replies
  • September 5, 2017

What is the source format?  I'm a bit concerned that the reader will be a bit confused at having several columns with the same name.  I checked and the CSV reader will add a suffix to duplicated column names so that is a way in. And then @david_r's technique works swimmingly.

I tested with multiple identically named columns in Excel and FME was kind enough to suffix them for me, as I imagine it does for CSV:

 

Segment
Segment00
Segment01
Segment02
Segment03
...
Slightly confusing that the first occurrence isn't numbered, but the ListPopulator seems clever enough to take that into account, so no sweat.

Forum|alt.badge.img+1
  • Author
  • 19 replies
  • September 5, 2017

Thanks @david_r

Once again FME delivering brilliant support, I really like this product and the community!

 

As an aside, I was getting a lot of `MISSING_PARAMETER_LIST' rejections on the ListExpldoer as my lists were not all the same length and contained missing records. I realised that by importing the CSV and reading blank cells as 'NULL' rather than 'missing' I was not getting any `MISSING_PARAMETER_LIST'. on my ListExploder.

Once I exploded the list I filtered out the NULL records.

This is the value I set in the reader.


david_r
Celebrity
  • 8394 replies
  • September 5, 2017

Thanks @david_r

Once again FME delivering brilliant support, I really like this product and the community!

 

As an aside, I was getting a lot of `MISSING_PARAMETER_LIST' rejections on the ListExpldoer as my lists were not all the same length and contained missing records. I realised that by importing the CSV and reading blank cells as 'NULL' rather than 'missing' I was not getting any `MISSING_PARAMETER_LIST'. on my ListExploder.

Once I exploded the list I filtered out the NULL records.

This is the value I set in the reader.

Great to hear you got it to work and thanks for letting us all know about this important detail.