Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Delete Duplicates in table

Hello,

I have a table like this:

AA-TEST
CTEST
BB-TEST
CC-TEST

I want to delete lines to get a table like this:

AA-TEST
BB-TEST
CC-TEST

When you have two lines with the same key (first column), just preserve the last one.

Can someone help me on this please?

Thanks,

Regards,

Loïc

1 Solution

Accepted Solutions
Employee
Employee

Re: Delete Duplicates in table

T:

LOAD F1,F2,-RecNo() as Ord INLINE [

    F1, F2

    A, A-TEST

    C, TEST

    B, B-TEST

    C, C-TEST

];

LOAD

  F1 as Final,

  F2

Resident T

Where not Exists(Final,F1)

order by Ord;

drop table T;

2 Replies
Employee
Employee

Re: Delete Duplicates in table

T:

LOAD F1,F2,-RecNo() as Ord INLINE [

    F1, F2

    A, A-TEST

    C, TEST

    B, B-TEST

    C, C-TEST

];

LOAD

  F1 as Final,

  F2

Resident T

Where not Exists(Final,F1)

order by Ord;

drop table T;

Not applicable

Re: Delete Duplicates in table

Also in Presentation Tab, Select the 'Final' column and check 'Omit Rows Where Field is NULL'.

Community Browser