I am receiving a file(s) like below, with header as Keys.
So I need to transpose the data to (Key, Value) pairs dynamically. I am able to convert using the Pivot Enterprise stage with Horizontal Pivot, but how to capture the Header and generate the column as shown in desired output?
Code: Select all
File1:
UID|Age|Income|Golf|Outdoor
nabvj42|30|80000|Y|Y
ahfva87987|27|20000|N|N
File2:
UID|MarStatus|Car|Geek|Income
hf7gsb|N|Y|Y|20000
hgj780|Y|Y|N|90000
Code: Select all
File1:
nabvj42|Age|30
nabvj42|Income|80000
nabvj42|Golf|Y
File2:
hf7gsb|MarStatus|N
hf7gsb|Car|Y
hf7gsb|Geek|Y
hf7gsb|Income|20000
Code: Select all
UID|Key|Value