Skip to main content
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: 
KirstenKa
Creator II
Creator II

remove duplicate 1 value only in load script

My loadscript looks like this and I would like to remove duplicates for Trading Co only, adding distinct next to load doesn’t work. Don’t know how to remove duplicates for the specific value Trading Co only, how to integrate this in the load script. See also attachment

KirstenKa_2-1689097961529.png

 

KirstenKa_3-1689097961532.png

 

 

 

Labels (1)
17 Replies
MarcoWedel

Can you please post some examples of how removing duplicates for only one field would look like?

KirstenKa
Creator II
Creator II
Author

Hi @MarcoWedel  see attachment

Ravi_Nagmal
Contributor III
Contributor III

@KirstenKa  you can use firstsortedvalue function based on date if you have date field

https://help.qlik.com/en-US/sense/May2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/BasicAggre...

Hania
Creator
Creator

Hello, @KirstenKa 

You Can try By doing Group By,

Eg.

Load *,

Resident [Table Name]

Group by "Trading Co", "Item Id";

If This Helpful for You Please mark Answer  as solution! 

 

tealowk
Partner - Contributor III
Partner - Contributor III

Hi Kristen,

if you use 

Load distinct "Trading Co" from MySource; 

this will result in a table containing only unique "Trading Co" values. 

I don't know how you want to analyse the data afterwards and thus don't understand why duplicate values of the "Trading Co" field do matter. Could you please provide some further details?

Kind regards,

Thilo

KirstenKa
Creator II
Creator II
Author

Thanks @tealowk 

It doesn't work in my script, also tried "mysource" between brackets and "Distinct" right before Trading Co. See also attachment 

KirstenKa_0-1689359398829.png

 

KirstenKa
Creator II
Creator II
Author

Ok thanks I need to look into it and try

MarcoWedel

maybe like this?

MarcoWedel_0-1689367048783.png

table1:
LOAD [Trading code], 
     Item
FROM [https://community.qlik.com/cyjdu72974/attachments/cyjdu72974/new-to-qlik-sense/233798/1/Remove%20duplicates%20based%20on%201%20value.xlsx] (ooxml, embedded labels, table is Sheet1)
Where not Exists([Trading code]);

 

tealowk
Partner - Contributor III
Partner - Contributor III

You need to replace MySource by your actual source and remove all the other fields that you load in the table.