Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I would like to load data from the field [Category] that contains values that I want to break out into separate fields e.g.:
Name_[Type]_[Segment]
John_Blue_Big
Anna_Green_Small
George_Blue_Small
How should the script be written to load the values as 3 separate fields (Name, Type, Segment)?
Thank you!
You can use the function SubField() - look it up
Hi Jason,
For your requirement and example... consider the following...
I created an inline table with the following...
Table:
load * inline [
Field1
Name_Type_Segment
]
;
To break out each value into its own field, you can use the following...
Table2:
load
SubField(Field1,'_',1) as Name,
SubField(Field1,'_',2) as Type,
SubField(Field1,'_',-1) as Segment
resident Table
;
Hope this helps.
Simon
You can use subfield with different arguments.
subfield(Field,'_',1) as Column1
subfield(Field,'_',2) as Column2
subfield(Field,'_',3) as Column3