0

I have one step that I need to concat x rows into one separated by coma or similar. I have this data on my final step:

enter image description here

I need to have the "tarifas" row in the same column with the 5 diferent "tarifas" for the same "REFERENCIA" : example:

tarifas:

T00:6.9000,T01:7.9000,T02:8.9000,T03:9.9000,T04:10.9000,T05:11.9000

I saw denormalizer step but can't get a good result.

Cyrus
  • 2,135
  • 2
  • 11
  • 14
Gerard Luque
  • 163
  • 2
  • 13

1 Answers1

1

Have you tried the Group By step?

It has an operation called Concatenate string separated by , which is exactly what you want here. For your other non-group fields use First non-null value as the operation.

Make sure your data is sorted on the group field and then the tarifas field.

Cyrus
  • 2,135
  • 2
  • 11
  • 14
  • That worked perfectly but for some reason I get the new row with some duplicates for example: T00:19.9000, T00:19.9000, T00:19.9000, T01:20.9000, T02:21.9000, T03:22.9000, T04:23.9000, T05:24.9000 – Gerard Luque Feb 27 '17 at 11:51
  • If you preview the data coming from the step just before the Group By, are there duplicate rows, is the stream correctly sorted on the group by field (b2btad_REFERENCIA) and the tarifas field? – Cyrus Feb 27 '17 at 11:57
  • You must sort rows before grouping by the same columns. – Rudolf Yurgenson Mar 02 '17 at 07:26