Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to eliminate the duplicate rows in qlikvew

how to eliminate the duplicate rows in qlikvew

idname
1a
1a
2b
2c
3d

i want to o/p like this

1 a

2 b

3 d

eliminates the duplicates in id.

23 Replies
Anonymous
Not applicable
Author

Use Distinct keyword before the fields.

like

Load Distinct

EmpId,

empname

From......(Location of source file)

peschu123
Partner - Creator III
Partner - Creator III

Hi Ruben,

could you please provide an example file with your solution?

Regards,

Peter

Not applicable
Author

Try this

Test:

load * inline

[

id,name

1,a

1,a

2,b

2,c

3,d

];

Final:

Load

Distinct

id as [Identifier],

name as [Final Name]

Resident

Test

Where not exists ('id',id);

maxgro
MVP
MVP

Result

1.png

Script

tab1:

LOAD * INLINE [

   ID, Name

    1, a

    1, a

    2, b

    2, c

    3, d

];

tab2:

NoConcatenate load

ID, Name

Resident

tab1

where ID<>peek(ID)

order by ID, Name;

DROP Table tab1;

jyothish8807
Master II
Master II

Thanx amit, got it.

I added noconcatenate and it worked.

Regards

KC

Best Regards,
KC
rubenmarin

Sure, but is simple, just a script with:

Data:

LOAD * INLINE [

    id,name

    1,a

    1,a

    2,b

    2,c

    3,d

] Where not exists('id', id);

maxgro
MVP
MVP

another one could be

tab2:

NoConcatenate load

ID, MinString(Name)

Resident

tab1

group by ID;

DROP Table tab1;

peschu123
Partner - Creator III
Partner - Creator III

Ok Thank you.

It doesn't work with a resident load? I tried that with resident load and I got an empty table.

Regards,

Peter

rubenmarin

That's because of autoconcatenating, use NoConcatenate to especify you don't want to concatenate tables with the same fields:

table2:

NoConcatenate LOAD .... resident table1;

peschu123
Partner - Creator III
Partner - Creator III

I did this...

INPUT:

LOAD * INLINE [

    id, name

    1, a

    2, a

    2, b

    3, c

    3, d

    4, a

    4, b

    4, c

];

OUTPUT:

NoConcatenate LOAD

  id,

  name

Resident INPUT where not exists('id', id);

DROP Table INPUT;