Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a possibility to do some type of reverse Cross table function , whereby information that is stored on a line base , get converted to a column base ( in the data import process) . Reason I need to assemble multiple lines (for instance processes ) for 1 Company into 1 line , whereby the number of lines and sequence of the values in the process is randomn per Company
For instance (simplified version ) , I havc a file with
Company 1 Process A
Company 1 Process D
Company 2 Process A
Company 2 Process C
Company 3 Process D
And I would like to end up with having the processes preferably as concatenated values (see below) or if not feasible in seperate columns ...
Company 1 , Process A - Process D
Company 2 , Process A - Process C
Company 3 , Process D
Yes, you can use the Generic Load:
Try below
Test:
Load Company,Concat(Process,'-') as NewProcess group by Company;
Load * Inline [
Company, Process
Company 1,Process A
Company 1,Process D
Company 2,Process A
Company 2,Process C
Company 3,Process D
];
Regards,
Prashant Sangle
Hi @HWallays ,
You can try something like the following script & expand on it as per your data model :
T:
Load * Inline [
Company, Process
Company 1,Process A
Company 1,Process D
Company 2,Process A
Company 2,Process C
Company 3,Process D
];
Temp :
Load
Concat(distinct chr(39)&Process&chr(39),',') as Plist
Resident T;
let vPList=peek('Plist',0,'Temp');
Drop table Temp;
New:
Load Distinct
Company
Resident T;
for each i in $(vPList)
left join(New)
Load
Company,
1 as [$(i)]
Resident T where Process='$(i)';
next i;
Drop table T;
exit Script;
Find the below output :
Let me know if it worked for you.
Regards,
Rohan.
THanks for your replies guys, you made my day. Indeed I was able to fix this via the concat command ( which was new to me ). An easy solution for a blocking issue 😉