Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
id, service1, service2, service3
x, 123, 234, 345
y, 456, 567, 678
id, type, qty
x, service1, 123
x, service2, 234
x, service4, 345
y, service1, 456
y, service2, 567
y, service3, 678
output_row.id = input_row.id;
output_row.line = "service1:" + input_row.service1 + ";service2:" + input_row.service2 + ";service3:" + input_row.service3;
Hi,
Separate your flow in two steps. First separate your type fields by ';' operator using
tfileinputrow-->String handling (replace all occurances of ',' by ';' except first)-->tfileoutput
Your data would look like
x, 123; 234; 345
y, 456; 567; 678
use following flow to generate service1,service2..etc
Following code was used in tJavarow
//Code generated according to input schema and output schema
output_row.id = input_row.id;
if (id_tMemorizeRows_1== id_tMemorizeRows_1)
{
context.cnt = context.cnt+1;
output_row.Services = "Services"+context.cnt.toString();
}
else if (id_tMemorizeRows_1!= id_tMemorizeRows_1)
{
context.cnt = 1;
output_row.Services = "Services"+context.cnt.toString();
}
output_row.Type = input_row.Type;
Thanks
vaibhav