Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Can anyone please help me to with below issue?
I have a table like this
ID, Region, Products
1 ,NA, Apple ; Mango ; Peach ; Pear
2, SA , Apple
3, APAC , Mango ; Apple
4 , APAC , Pear
How can i create a tables like this from above table
Table 1:
ID, Region, Products
1 ,NA, Apple
Table2:
ID, Region, Products
1 ,NA, Mango
Table3:
ID, Region, Products
1 ,NA, Peach
Table3.1:
ID, Region, Products
1 ,NA, Pear
Table4:
ID, Region, Products
2, SA , Apple
Table5:
ID, Region, Products
3, APAC , Mango
Table5:
ID, Region, Products
4, APAC , Pear
Thanks in Advance
Hi, try this code:
// Creation of the inline table with the original data
Data:
LOAD * INLINE [
ID, Region, Products
1, NA, Apple ; Mango ; Peach ; Pear
2, SA, Apple
3, APAC, Mango ; Apple
4, APAC, Pear
];
// Load the disaggregated data
DesaggregatedData:
LOAD
ID,
Region,
Trim(SubField(Products, ';')) AS Product
RESIDENT Data;
// Delete the temporary table "Data"
DROP TABLE Data;
Regarts.
Hi, try this code:
// Creation of the inline table with the original data
Data:
LOAD * INLINE [
ID, Region, Products
1, NA, Apple ; Mango ; Peach ; Pear
2, SA, Apple
3, APAC, Mango ; Apple
4, APAC, Pear
];
// Load the disaggregated data
DesaggregatedData:
LOAD
ID,
Region,
Trim(SubField(Products, ';')) AS Product
RESIDENT Data;
// Delete the temporary table "Data"
DROP TABLE Data;
Regarts.