Skip to main content
Solved

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


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)

View original
Did this help you find an answer to your question?

4 replies

takashi
Evangelist
  • 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
  • October 24, 2018
takashi wrote:

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
Evangelist
  • October 25, 2018
edhere wrote:
@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
  • October 25, 2018
takashi wrote:
Try sorting the features by "station.timeBegin" ascending, before the Counter.
That worked, thank you!

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings