Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

Left Join: Avoid duplicates

Hi,

i would like to do a left join and avoid duplicates.

I would like to join using the "item" but as you can see on the "left-join" table for the same item there are more than 1 record. What i would like to do is to join using only the most recent value in case more than 1 item are found: so what is in sequence 1-4 will be ignored.

there is any way i can do this?

left join.PNG

Labels (1)
3 Replies
Vegar
MVP
MVP

You could use FirstSortedValue() to solve this.

Sales:
LOAD Item, Amount
FROM Sales;

LEFT JOIN (Sales)
LOAD 
Item,
FirstSortedValue ( Info, -Sequence) as Info
FROM LeftJoinTable
GROUP BY Item;

 

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Might help you:

Left Join (sales)

Load Item

,Info

,Max(Sequence) as Sequence

Resident LeftJoinTable

Group By Item, Info;

 

Brett_Bleess
Former Employee
Former Employee

You have two possible solutions posted, we would greatly appreciate it if you would return to your thread and close things out by using the Accept as Solution button on the post(s) that helped you with the use case.  If you did something different, you can post that and then mark that using the button, and if you still have further questions, please leave an update post.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.