Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
GeorgePhilips2302
Contributor II
Contributor II

Remove duplicates in QlikView Script

City field  in the attached file has duplicate values with different geographykey values,

I want to remove the duplicates and keep one unique city with any one geographykey.

Variety of solutions expected!

Labels (1)
1 Solution

Accepted Solutions
QFabian
Specialist III
Specialist III

Hi @GeorgePhilips2302 , please check this.

In this case, there is no duplicate, because they are different State 

116 Augsburg Bayern Germany
137 Augsburg Hamburg Germany

 

But for the rest works properly, or do you need not to consider the field State for the duplicates?

 

This is the Script that i made for you :

Data:
LOAD distinct
City,
State,
Country,
min(GeographyKey) as GeographyKey
FROM [..\Users\Qlik\Desktop\Remove duplicates.xls]
(biff, embedded labels, table is Sheet1$)
Group By
City,
State,
Country;

 

 

QFabian

View solution in original post

4 Replies
QFabian
Specialist III
Specialist III

Hi @GeorgePhilips2302 , please check this.

In this case, there is no duplicate, because they are different State 

116 Augsburg Bayern Germany
137 Augsburg Hamburg Germany

 

But for the rest works properly, or do you need not to consider the field State for the duplicates?

 

This is the Script that i made for you :

Data:
LOAD distinct
City,
State,
Country,
min(GeographyKey) as GeographyKey
FROM [..\Users\Qlik\Desktop\Remove duplicates.xls]
(biff, embedded labels, table is Sheet1$)
Group By
City,
State,
Country;

 

 

QFabian
GeorgePhilips2302
Contributor II
Contributor II
Author

This works but the geographykey which had duplicates are now showing null, how can i remove them off completely, Refer attached file.

QFabian
Specialist III
Specialist III

@GeorgePhilips2302 maybe that values comes from another tabla with that field, making a key ?

Then you can hide that values in your chart

QFabian_0-1674569243256.png

 

 

QFabian
GeorgePhilips2302
Contributor II
Contributor II
Author

Okay, Thank you buddy!