Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to append/conatenate two (or more) tables but the condition is if a field value already exists, that row should not get appended.
For example:
Concatenated_Tabel:
Load
Name,
Period,
Group,
Rank
Resident Tabl1
Where Name = 'some name'
and group = 'some group'
and rank = '1'
concatenate (Concatenated_Tabel)
Load
Name,
Period,
Group,
Rank
Resident Tabl1
Where Name = 'some name'
and group = 'some group'
and rank = '3'
If value of Name already exists in Concatenated_Tabel then it shold not get added to it.
Thanks.
Can't edit, I'm using mobile device. Replace
Load distinct Name as
with
Load distinct ctName as
concatenate (Concatenated_Tabel)
Load
Name,
Period,
Group,
Rank
Resident Tabl1
Where Name = 'some name'
and group = 'some group'
and rank = '3'
and not exists(Name)
This doesn't seem to work, let me explain this more by below example:
Original_Table:
Load
Name,
Period,
Group,
Rank
...
From QVD;
Concatenated_Tabel:
Load
Name As ctName,
Period As ctPeriod,
Group As ctGroup,
Rank As ctRank
Resident Original_Table
Where Name = 'some name'
and group = 'some group'
and rank = '1';
concatenate (Concatenated_Tabel)
Load
Name As ctName,
Period As ctPeriod,
Group As ctGroup,
Rank As ctRank
Resident Original_Table
Where Name = 'some name'
and group = 'some group'
and rank = '3';
Original_Table:
Load
Name,
Period,
Group,
Rank
...
From QVD;
Concatenated_Tabel:
Load
Name As ctName,
Period As ctPeriod,
Group As ctGroup,
Rank As ctRank
Resident Original_Table
Where Name = 'some name'
and group = 'some group'
and rank = '1';
Temp:
Load distinct Name as AlreadyLoaded
Resident Concatenated_Tabel;
concatenate (Concatenated_Tabel)
Load
Name As ctName,
Period As ctPeriod,
Group As ctGroup,
Rank As ctRank
Resident Original_Table
Where Name = 'some name'
and group = 'some group'
and rank = '3'
and not exists (AlreadyLoaded, Name);
Can't edit, I'm using mobile device. Replace
Load distinct Name as
with
Load distinct ctName as
Thank you very much !