Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikconsultant
Creator III
Creator III

Transform multiple rows in one row

Hi,

I have the following problem:

Data source:

Key Field A
50|18052594|632000|11,91 3211
50|18052594|632000|11,91 3219
50|18052594|632000|11,91 3329
50|18052594|632000|11,91 4100
50|18052594|632000|11,91

4201

50|18052594|632002|11,91

4201

...

 

 

I need to transform  this data in the load script to this:

Key Field A
50|18052594|632000|11,91 3211, 3219, 3329, 4100, 4201
50|18052594|632002|11,91 4201
...  

 

Is there a way to do this? Thanks in advance.

Labels (2)
1 Solution

Accepted Solutions
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi,

 

you can try Concat() with a group by

tabl1:
Load
   concat(field2,',') as filed3,
   field1
group by field1;
Load * inline [
   field1,field2
   50|18052594|632000|11|91,3211
   50|18052594|632000|11|91,3219
   50|18052594|632000|11|91,3329 
   50|18052594|632000|11|91,4100
   50|18052594|632000|11|91,4201
   50|18052594|632002|11|91,4201
];

Keep in mind that in my script for the inline not to create a new column for me, i changed ",91" to "|91"

in your case you will not have to do it.

Hope it helps,

View solution in original post

2 Replies
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi,

 

you can try Concat() with a group by

tabl1:
Load
   concat(field2,',') as filed3,
   field1
group by field1;
Load * inline [
   field1,field2
   50|18052594|632000|11|91,3211
   50|18052594|632000|11|91,3219
   50|18052594|632000|11|91,3329 
   50|18052594|632000|11|91,4100
   50|18052594|632000|11|91,4201
   50|18052594|632002|11|91,4201
];

Keep in mind that in my script for the inline not to create a new column for me, i changed ",91" to "|91"

in your case you will not have to do it.

Hope it helps,

qlikconsultant
Creator III
Creator III
Author

Thanks, my idea would have been more complicated.