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

Remove duplicate an leave higher value

Hello,

I am having trouble removing the duplicates from my load. I know I am able to remove duplicates by using the distinct load, but that doesn't allow me to pick wich values are the ones that stay.

Thanks!

1 Solution

Accepted Solutions
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Sara,

one technique might be to calculate the value field you are interested in, and JOIN this back on to your original table. For example:

OriginalTable:

LOAD

    key,

    value,

    etc, etc....

FROM

[wherever your original source is];

INNER JOIN (OriginalTable)

LOAD

    key,

    max(value) as value

RESIDENT OriginalTable

GROUP BY key;

View solution in original post

1 Reply
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Sara,

one technique might be to calculate the value field you are interested in, and JOIN this back on to your original table. For example:

OriginalTable:

LOAD

    key,

    value,

    etc, etc....

FROM

[wherever your original source is];

INNER JOIN (OriginalTable)

LOAD

    key,

    max(value) as value

RESIDENT OriginalTable

GROUP BY key;