Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table with fields Id, Date, Outlet and ending with a particular word like Service.
I want to arrive at a table where all the fields ending with Service are put together in a single column.
Can someone help me please. Thank you.
It's not possible to query and/or conditionally modify the origin field-names within a load. For such tasks you will always need additionally measures in beforehand or afterwards which give you the information to pick respectively to filter on the wanted values.
In your case I wouldn't go this expensive way else I would do something like this:
t1: crosstable(Company, Service, 3) load * from Source;
t2: load ID, Date, Outlet, Company, mid(Service, 1, index(Service, ' ', -1)-1) as Service
resident t1 where subfield(Service, ' ', -1) = 'Service';
- Marcus
It's not possible to query and/or conditionally modify the origin field-names within a load. For such tasks you will always need additionally measures in beforehand or afterwards which give you the information to pick respectively to filter on the wanted values.
In your case I wouldn't go this expensive way else I would do something like this:
t1: crosstable(Company, Service, 3) load * from Source;
t2: load ID, Date, Outlet, Company, mid(Service, 1, index(Service, ' ', -1)-1) as Service
resident t1 where subfield(Service, ' ', -1) = 'Service';
- Marcus