Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

filter for distinct field

Hi,

I have a table A where each record has a unique ID.

I have created a table B from table A by concatenating various conditions.

I have now realised some records appear 2 or more times in table B as they belong to 2 or more conditions. How can I filter to only show each unique ID once?

I realised i can do count (distinct unique ID) in a chart, however this adds an additional column which i dont want.

Does anyone know of a solution to this problem?

Thanks,

5 Replies
nilesh_gangurde
Partner - Specialist
Partner - Specialist

hii,

use "Distinct" at the time of load. then your scrip of loading table B is as follows:

B:

load distinct * from table B;

-Nilesh

Not applicable
Author

hi,

table A contains distinct unique IDs.

what I am doing at the moment is:

tableB:

load

1,

2

resident tableA

where condition1;

concatenate load

1,

2

resident tableA

where condition 2;

hence your method nilesh doesnt accomplish the desired result.

thanks for your help though. hopefully my clarification helps.

Not applicable
Author

hi,

table A contains distinct unique IDs.

what I am doing at the moment is:

tableB:

load

1,

2

resident tableA

where condition1;

concatenate load

1,

2

resident tableA

where condition 2;

hence your method nilesh doesnt accomplish the desired result.

thanks for your help though. hopefully my clarification helps.

nilesh_gangurde
Partner - Specialist
Partner - Specialist

if you are concatenating the two tables its difficult to have distinct values...

instead of that you can join the two tables on the field "1"....

-Nilesh

Not applicable
Author

Hi ,

      Try this code below

tableB:

load

1,

2

resident tableA

where condition1;

concatenate

Load *

where not Exists(1); //Field1 Name

load

1,

2

resident tableA

where condition 2;

Regards

//Yusuf