Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greetings,
I've a table setup like this :
ID | Definition | Name |
---|---|---|
1 | First Name | Alexander |
2 | Last Name | Wise |
3 | First Name | Chris |
4 | Last Name | Damico |
5 | First Name | Frederick |
6 | Last Name | Leviathan |
And i'm wondering if there is a way to merge them to have a table like this:
ID | Name |
---|---|
1 | Alexander Wise |
3 | Chris Damico |
5 | Frederick Leviathan |
And will i have to create a new table for this ? or is it possible to change the first one ?
Thanks for answer/tips
I see, so you have a key to match
then follow this logic:
table_tmp:
load
registrary_number,
Name as First
from [table]
where Definition='First name';
left join(table_tmp)
Load
registrary_number,
Name as Last
from
here a script is not First and last Name
greetings Gerry
ReadTable:
load * inline [
ID, Definition,Name
1, FirstName, Alexander
2, LastName, Wise
3, FirstName, Chris
4, LastName, Damico
5, FirstName, Frederick
6, LastName, Leviathan
7, LastName, NewName
8, LastName, NewName2
];
EndTable:
load *
where not FirstLastName = 'Del'
;
load
if (Definition = 'LastName' and Previous(Definition) = 'FirstName' , previous(Name)&', '&Name,
if (Definition = 'LastName' and Previous(Definition) = 'LastName', 'noFirstname'&', '&Name , 'Del')) as FirstLastName ,
if (Definition = 'LastName' and Previous(Definition) = 'FirstName' , previous(ID),
if (Definition = 'LastName' and Previous(Definition) = 'LastName', ID , 'Del')) as ID_NEW
resident ReadTable;
drop Table ReadTable;
Hi Gerold,
It is okay, but VIncent post an extra information since,
So the matching pair would always have the same Registrary number
there can be the case the rownumbers are not consecutives, but the registrary number is the key for match.
G.