Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would transform a columns to header in a script, but I don't found any solution.
For example,I have this data :
Id | Key | Value |
---|---|---|
1 | AZE | 10 |
1 | QSD | 30 |
2 | AZE | 25 |
3 | WXC | 60 |
4 | AZE | 20 |
4 | QSD | 60 |
4 | WXC | 90 |
And I would obtain this :
Id | AZE | QSD | WXC |
---|---|---|---|
1 | 10 | 30 | |
2 | 25 | ||
3 | 60 | ||
4 | 20 | 60 | 90 |
Have you an idea, how to do this ?
Thank you in advance
Cédric
Hi,
use
generic LOAD Id,
Key,
Value
FROM Excel;
Mark answered if it helps
Hi,
use
generic LOAD Id,
Key,
Value
FROM Excel;
Mark answered if it helps
Hi
If someone have the same problem, there is my code :
tmp:
Generic LOAD * Resident tbl_source;
Result:
load distinct ID resident tbl_source;
drop table tbl_source;
FOR i = 0 to NoOfTables()
TableList:
LOAD TableName($(i)) as Tablename AUTOGENERATE 1
WHERE WildMatch(TableName($(i)), 'tmp.*');
NEXT i
FOR i = 1 to FieldValueCount('Tablename')
LET vTable = FieldValue('Tablename', $(i));
LEFT JOIN (Result) LOAD * RESIDENT $(vTable);
DROP TABLE $(vTable);
NEXT i
drop table TableList;
Thank you for your help
Cédric