Skip to main content
Solved

Aggregate and Rearrange Tabular Data

  • July 3, 2017
  • 7 replies
  • 82 views

carmijo
Supporter
Forum|alt.badge.img+11

Hi All,

I'm attempting to rearrange table A into table B using FME 2017.0.

A

B

I've followed FME's advanced manipulation of tables help, and i can get to this output (below) but i'm having a difficult time getting the premise ID in it's own column and bringing in the additional premise's info.

Any help would be greately appreciated.

-----------------------------------------------------------------

Workspace:

Input CSV:

------------------------------------------------------------------

Best answer by ebygomm

I don't have access to 2017 so I cannot see what it is you've done so far, but this workflow does what you need

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.

7 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • July 3, 2017

I don't have access to 2017 so I cannot see what it is you've done so far, but this workflow does what you need


carmijo
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • July 4, 2017

I don't have access to 2017 so I cannot see what it is you've done so far, but this workflow does what you need

This works great. However, i'm still having some trouble getting from the aggregator output to a CSV writer. When I view the aggregator output in inspector, the D_% fields are separated as i'd like, but when I attempt to write from aggregator to CSV, the D_% fields are still comma separated and have no values. Of course, this makes sense, but I've tried using an attribute splitter and attribute manager to split out these fields, but I can't seem to get it to work. Any additional help would be much appreciated.

 

 

 


takashi
Celebrity
  • July 5, 2017
This works great. However, i'm still having some trouble getting from the aggregator output to a CSV writer. When I view the aggregator output in inspector, the D_% fields are separated as i'd like, but when I attempt to write from aggregator to CSV, the D_% fields are still comma separated and have no values. Of course, this makes sense, but I've tried using an attribute splitter and attribute manager to split out these fields, but I can't seem to get it to work. Any additional help would be much appreciated.

 

 

 

Possibly you have exposed a comma separated single name like "D_AREA,D_FLAT,D_IMPERV,D_PRCT,D_PRCTIM,D_RESPON"?

 

Make sure that the AttributeExpose parameters looks like this.

 

 


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • July 5, 2017

Would the AttributePivoter transformer be of help here?

Sounds like you are creating a pivot table.


carmijo
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • July 5, 2017

Would the AttributePivoter transformer be of help here?

Sounds like you are creating a pivot table.

That's the first thing that came to mind for me too. It seems like it would, but I haven't gone down that path yet.

takashi
Celebrity
  • July 5, 2017
This works great. However, i'm still having some trouble getting from the aggregator output to a CSV writer. When I view the aggregator output in inspector, the D_% fields are separated as i'd like, but when I attempt to write from aggregator to CSV, the D_% fields are still comma separated and have no values. Of course, this makes sense, but I've tried using an attribute splitter and attribute manager to split out these fields, but I can't seem to get it to work. Any additional help would be much appreciated.

 

 

 

Make sure if the attribute names you have exposed are exactly match the values of "CHAR_TYPE_CD" read from the source CSV. Some CHAR_TYPE_CD values (e.g "D_AREA ") seem to contain trailing spaces.

 

 


carmijo
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • July 5, 2017
Make sure if the attribute names you have exposed are exactly match the values of "CHAR_TYPE_CD" read from the source CSV. Some CHAR_TYPE_CD values (e.g "D_AREA ") seem to contain trailing spaces.

 

 

Haha, of course. Thank you @takashi, that was it.

 

 

The three attributes that were missing had trailing spaces in the source data. I used an attribute trimmer after the reader to fix the problem