Solved

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

  • 22 October 2018
  • 4 replies
  • 4 views

Badge

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

icon

Best answer by takashi 22 October 2018, 15:30

View original

4 replies

Userlevel 2
Badge +17

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

rename-and-aggregate.fmwt (FME 2018.1.0.3)

Badge

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

 

 

Userlevel 2
Badge +17
@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.
Badge
Try sorting the features by "station.timeBegin" ascending, before the Counter.
That worked, thank you!

 

Reply