Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
if a have a table with the following structure:
[ col1,col2,col3
col1Val1,2,3
col1Val2,4,5
col1Val3,6,7
];
and i wish to transform it like this
[colAndRow,Value
col1Val1col2,2
col1Val1col3,3
col1Val2col2,4
col1Val2col3,5
col1Val3col2,6
col1Val3col3,7
];
The first column contains the combination of the values of a specific column and all other column names,
and the second column contains the respective value in the base table.
Is this realizable in script?
Thank you!
Hello,
You need to use Crosstable to achive this.
Hello, here is a solution to your problem. The order in the table is not the same but that should not pose a problem.
TEST:
load *
Inline [
col1, col2, col3
col1Val1,2,3
col1Val2,4,5
col1Val3,6,7
];
TEST2:
Load
col1&'col2' as colAndRow,
col2 as Valeur
resident TEST;
Concatenate
Load
col1&'col3' as colAndRow,
col3 as Valeur
resident TEST;
Hello,
You need to use Crosstable to achive this.