Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
At the script level i need to convert row wise data to coulmn wise.
My source data is
Key | ID | Value |
---|---|---|
12 | 45 | ABC |
12 | 46 | SYZ |
12 | 47 | 93 |
13 | 45 | asd |
13 | 46 | gdfg |
13 | 47 | 63 |
and i need to get output like:
Key | Value 1 | Value 2 | Value 3 |
---|---|---|---|
12 | ABC | SYZ | 93 |
13 | asd | gdfg | 63 |
Please help me out to get this result at script level.
Thanks
Aashish
Hello Aashish,
We can achieve this by 2 ways, One with Generic Load and Other with Crosstable.
Please find below example with Generic Load : (Remember you need to have that IDcount column)
Source:
LOAD * INLINE [
Key, Value, IDcount
12, ABC, 1
12, SYZ, 2
12, 93, 3
13, asd, 1
13, gdfg, 2
13, 63, 3
];
GENERIC LOAD Key, 'Value' & IDcount, Value
RESIDENT Source;
Please let me know, if it was helpful
Thanks,
ASINGH
don't forget to drop the source table....