Skip to main content
Solved

XML to tabular - how to aggregate multiple values into one row?

  • October 22, 2018
  • 4 replies
  • 23 views

Forum|alt.badge.img

Hi FME ninjas,

I'm struggling trying to transform XML data to tabular data.

 

Attached is an example XML. I'm looking at records that have multiple opening hours per day of the week. (in the example dayNumber="2" is Monday)

Opening and closing time are in "timeBegin" / "timeEnd"

 

I'm trying to aggregate / merge these into one row.

What I'd like to have:

stationCode Monday1_open Monday1_close Monday2_open Monday2_close RNSC01 0700 1200 1400 1800

Thanks,

 

Ed

Best answer by takashi

Hi @edhere, if I have understood the requirement correctly, this workflow might help you.

rename-and-aggregate.fmwt (FME 2018.1.0.3)

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.

4 replies

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • October 22, 2018

Hi @edhere, if I have understood the requirement correctly, this workflow might help you.

rename-and-aggregate.fmwt (FME 2018.1.0.3)


Forum|alt.badge.img
  • Author
  • 60 replies
  • October 24, 2018

Hi @edhere, if I have understood the requirement correctly, this workflow might help you.

rename-and-aggregate.fmwt (FME 2018.1.0.3)

@takashi

 

 

There is one more problem I'm facing: the early / late hours seem to be mixed up.

 

In above example the late hours end up in the first _1 group, the early hours are in the _2 group.

 

Is there a way to sort them so the early hours always end up in the _1 group?

 

 

Thanks,

 

Ed

 

 


takashi
Celebrity
  • 7843 replies
  • October 25, 2018
@takashi

 

 

There is one more problem I'm facing: the early / late hours seem to be mixed up.

 

In above example the late hours end up in the first _1 group, the early hours are in the _2 group.

 

Is there a way to sort them so the early hours always end up in the _1 group?

 

 

Thanks,

 

Ed

 

 

Try sorting the features by "station.timeBegin" ascending, before the Counter.

Forum|alt.badge.img
  • Author
  • 60 replies
  • October 25, 2018
Try sorting the features by "station.timeBegin" ascending, before the Counter.
That worked, thank you!