Hi, I have an input XML file. I would like to obtain the following result : id | picture1 | picture2 | picture3 1 | 7355448.jpg | 7893544.jpg | 2364758.jpg 2 | 1234567.jpg | 7864125.jpg | 1478523.jpg 3 | 7391845.jpg | 7319846.jpg | 7829657.jpg ... For one id, i can have one or several pictures. In the output Excel, I would like to obtain only the first three pictures. When I realize the mapping, I get the following result : id | picture1 1| 7355448.jpg 1| 7893544.jpg 1| 2364758.jpg 1| 7365599.jpg 1| 7733548.jpg 2| 1234567.jpg 2| 7864125.jpg 2| 1478523.jpg 2| 1122778.jpg 2| 9977443.jpg ... Can I do that with TOS ? How to solve the problem ? Regards.
may not be optimized but I have a small hint...
- Read xml file
- Merge three columns into Picture1 with separator as "|" using tMap/javarow and string concatenations
- Use tNormalize for Picture1 column
- Use tJavaRow - create new column as rowcnt - Identify row count where id is 1
- use filter component to filter out where rowcnt > 3
Vaibhav
Hi SPITman, It could be possible with TOS but the output you expected is not clear. I got the output in trasnposed format with the input file as you mentioned. i have used 3 outputs in tmap and applied inner join between keys for each picture type(1,2,3). output: .--+-----------. | tLogRow_1 | |=-+----------=| |id|picture1 | |=-+----------=| |1 |7355448.jpg| |1 |7893544.jpg| |1 |2364758.jpg| |2 |1234567.jpg| |2 |7864125.jpg| |2 |1478523.jpg| |3 |7391845.jpg| |3 |7319846.jpg| |3 |7829657.jpg| '--+-----------' Thanks, Bhanu.
Hi, In fact, I would like to obtain the following result : id | picture1 | picture2 | picture3 1 | 7355448.jpg | 7893544.jpg | 2364758.jpg 2 | 1234567.jpg | 7864125.jpg | 1478523.jpg 3 | 7391845.jpg | 7319846.jpg | 7829657.jpg
In the input XML file, I can have several pictures (25 for instance) for one id. In the output Excel, I would like to obtain only the first three pictures (COLUMNS and not ROWS)
I would like to obtain the following result : id | picture1 | picture2 | picture3 1 | 7355448.jpg | 7893544.jpg | 2364758.jpg 2 | 1234567.jpg | 7864125.jpg | 1478523.jpg 3 | 7391845.jpg | 7319846.jpg | 7829657.jpg
In the input XML file, I can have several pictures (25 for instance) for one id. In the output Excel, I would like to obtain only the first three pictures (in COLUMNS and not ROWS) That's all