Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i am exploring a ways to extract the employee Id as sperate column for one of my requirement.
input data and output has been attached in the image below.
is there any other options expect subfield to extract as a separate field and use it as a sperate column and curious if we can use any dynamic expression to get the same output.
Thanks in Advance.
Regards,
Raju
Hi, you can user subfield
Regards,
It couldn't be done within the UI but easily in the script by using subfield() to transform the strings into separate records and then a generic-load could be used to create such crosstable (you should have very strong reasons to build such data-structures because crosstables are quite unhandy).
the following script accomplishes your requirement:
Test:
Load *, index(replace(Attribute,',',''),value) as index;
Load text(EmployeeID) as EmployeeID,text(EmployeeID) as Attribute, text(subfield(EmployeeID,',')) as value;
Load * Inline [
EmployeeID
1
2,3,4
5,6,7
]
(delimiter is ';');
Generic Load EmployeeID, index ,value Resident Test;
drop table Test;