Solved

Simplifying a Table

  • 4 September 2017
  • 5 replies
  • 8 views

Badge +1

Hi folks I have this table:

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

Any help greatly appreciated.

Omar

icon

Best answer by david_r 4 September 2017, 19:15

View original

5 replies

Userlevel 4

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

Userlevel 4
Badge +13

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.

Userlevel 4

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.
Badge +1

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.

Userlevel 4

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.

Reply