back to forum.

Topic: one row to n rows Transformer

Topic by
gwarks

2012-01-02
15:34

one row to n rows Transformer

How to write Transformer extensions that return multiple rows per input row?

Reply by
kasper

2012-01-02
15:49
Hi,

You can do this by injecting a OutputRowCollector and submitting your records to it. This was something we introduced in DC 2.4 (or was it 2.3? I forget) so if you're looking at old examples, that's why it is not there.

But there's a simple example on this page though (scroll down a bit).

Reply by
kasper

2012-01-02
15:51
Btw. I would be curious to hear what kind of extension you are building :)

Reply by
gwarks

2012-01-04
10:56
Thanks that works. Except that @Inject is not needed.
So about what i am trying to made. I got an file with following rows:
codpat
ind1
dstart1
dstop1
dos1
ind2
dstart2
dstop2
dos2
ind3
dstart3
dstop3
dos3
...

But for analysis it would be better to have every single observation in it its own row.

Reply by
kasper

2012-01-05
21:42
Sounds like a neat little feature! Go ahead and submit it on the extensions page if you'd like to share it.

You need to be logged in to participate

In order to post your own comments on this topic, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen

 

Go back to forum.