Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Append Without Duplicate Field Value

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.

1 Solution

Accepted Solutions
luciancotea
Specialist
Specialist

Can't edit, I'm using mobile device. Replace

Load distinct Name as

with

Load distinct ctName as

View solution in original post

5 Replies
luciancotea
Specialist
Specialist

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)

Anonymous
Not applicable
Author

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';

luciancotea
Specialist
Specialist

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);

luciancotea
Specialist
Specialist

Can't edit, I'm using mobile device. Replace

Load distinct Name as

with

Load distinct ctName as

Anonymous
Not applicable
Author

Thank you very much !