Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
ID | Categories |
---|---|
1 | Car |
2 | Car|Bike |
3 | Car|Bike|Boat |
4 | Car|Bike|Boat|Plane |
ID | 1 | 2 | 3 | 4 |
---|---|---|---|---|
1 | Car | |||
2 | Car | Bike | ||
3 | Car | Bike | Boat | |
4 | Car | Bike | Boat | Plane |
Hi,
Little upgrade in Jagan code. Just added a code to join all the tables generated.
LET vStart = NoOfTables();
Test:
LOAD
ID,
If(Previous(ID) <> ID, 1, Peek(RowNo) + 1) AS RowNo,
Category;
LOAD
ID,
SubField(Categories, '|') AS Category
INLINe [
ID, Categories
1, Car
2, Car|Bike
3, Car|Bike|Boat
4, Car|Bike|Boat|Plane];
Split:
Generic
LOAD
*
Resident Test;
DROP TABLE Test;
LET vLoop = NoOfTables() - $(vStart) - 1;
//Rename first table name
RENAME Table Split.1 to Split;
FOR i = 1 to vLoop
LET vCurrentTable = 'Split.'& ($(i) + 1);
Left Join(Split)
LOAD
*
Resident
$(vCurrentTable);
DROP Table $(vCurrentTable);
NEXT
Hope it helps
Celambarasan
Hi,
Please find attached file for solution.
Regards,
Jagan.
Hi,
Little upgrade in Jagan code. Just added a code to join all the tables generated.
LET vStart = NoOfTables();
Test:
LOAD
ID,
If(Previous(ID) <> ID, 1, Peek(RowNo) + 1) AS RowNo,
Category;
LOAD
ID,
SubField(Categories, '|') AS Category
INLINe [
ID, Categories
1, Car
2, Car|Bike
3, Car|Bike|Boat
4, Car|Bike|Boat|Plane];
Split:
Generic
LOAD
*
Resident Test;
DROP TABLE Test;
LET vLoop = NoOfTables() - $(vStart) - 1;
//Rename first table name
RENAME Table Split.1 to Split;
FOR i = 1 to vLoop
LET vCurrentTable = 'Split.'& ($(i) + 1);
Left Join(Split)
LOAD
*
Resident
$(vCurrentTable);
DROP Table $(vCurrentTable);
NEXT
Hope it helps
Celambarasan
Amazing...Thank you to all that replied 🙂
Hi.
I was doing the example file when you got the answer.
Maybe another way to do it.
Alessandro Furtado