Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Discuss and learn more about design and development in formerly Talend products.
Hi @namerup
Check with this:
// Create a temporary table to hold the maximum number of comma-separated values
TempTable:
LOAD
Max(Len(ID) - Len(Replace(ID, ',', ''))) as MaxCommas
RESIDENT InputTable;
LET vMaxCommas = Peek('MaxCommas', 0, 'TempTable') + 1;
DROP TABLE TempTable;
// Create the output table by splitting the comma-separated values
OutputTable:
LOAD
SubField(ID, ',', IterNo()) as ID,
SubField(ColA, ',', IterNo()) as ColA,
SubField(ColB, ',', IterNo()) as ColB,
SubField(ColC, ',', IterNo()) as ColC
RESIDENT InputTable
WHILE IterNo() <= vMaxCommas;