Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have single field in my table and want it into 3 fields. Please note that field3 can have values with pipe sometimes. Please help!
eg-
Field1 Field2 Field3
Asia Oracle HK|YY
//Script
Data:
LOAD * INLINE [
Key
Asia|Oracle|China
Asia|Oracle|Japan
Asia|Oracle|HK|XX
Asia|Oracle|HK|YY
Asia|Oracle|HK|ZZ
];
Thanks!
Hi, here you have a posible solution:
for this load in your script:
LOAD
Data,
SubField(Data,'|',1) as Field1,
SubField(Data,'|',2) as Field2,
mid(Data,index(Data,'|',2)+1) as Field3
Hi, here you have a posible solution:
for this load in your script:
LOAD
Data,
SubField(Data,'|',1) as Field1,
SubField(Data,'|',2) as Field2,
mid(Data,index(Data,'|',2)+1) as Field3
Thanks for the quick response.
I see that you have used subfield function. I assume subfield effect the rows of my fact table, i might be wrong.
Can you help me without subfield function?
The suggestion from tincholiver will work. A subfield() with 3 parameters won't change the number of records - only the version with 2 parameters creates an internal table-loop with additionally records.
- Marcus