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: 
Not applicable

Remove duplicates in Resident

Hi people!!

Iam trying to remove duplicates in a resident statement with no success.
There is another way to achieve this?

Here i have the the data :

 

aabbcc
FCH20FCH20Innovum
FCH30FCH30Creo Antofagasta
FCH10FCH10Alimentos
00001000FCH20Innovum
00001605FCH10Alimentos

NOTE : I want to remove in base of a column called bb.. ( i want to know if it is possible)

My script:

area_grupoceco:

LOAD Distinct

     Area_ceco_PEP        as aa,

     @nombre_area_ceco as bb, 

     DescripcionArea       as cc

Resident Area;

Mensaje editado por: Ivan Diaz

1 Solution

Accepted Solutions
swuehl
MVP
MVP

If you want to keep only the records with first occurence of bb value, you can use NOT EXISTS:

area_grupoceco:

LOAD Distinct

     Area_ceco_PEP        as aa,

     @nombre_area_ceco as bb, 

     DescripcionArea       as cc

Resident Area

WHERE NOT EXISTS(bb,@nombre_area_ceco);


assuming that field bb is not already existing in a different table (loaded before area_grupoceco).

View solution in original post

7 Replies
swuehl
MVP
MVP

And what is your expected result? What do you count as duplicate?

Gysbert_Wassenaar

I don't see any duplicate records in the data you posted. Every record has a unique combination of field values.


talk is cheap, supply exceeds demand
maxgro
MVP
MVP

what's the expected result and why?

alexandros17
Partner - Champion III
Partner - Champion III

Please explain with more details

Not applicable
Author

i updated my question

swuehl
MVP
MVP

If you want to keep only the records with first occurence of bb value, you can use NOT EXISTS:

area_grupoceco:

LOAD Distinct

     Area_ceco_PEP        as aa,

     @nombre_area_ceco as bb, 

     DescripcionArea       as cc

Resident Area

WHERE NOT EXISTS(bb,@nombre_area_ceco);


assuming that field bb is not already existing in a different table (loaded before area_grupoceco).

maxgro
MVP
MVP

Area:

LOAD

  aa,

  bb,

    cc

FROM

[https://community.qlik.com/thread/177501?sr=inbox&ru=15823]

(html, codepage is 1252, embedded labels, table is @1);

area_grupoceco:

NoConcatenate

LOAD

    aa,

    bb,

    cc

Resident Area

where Previous(bb) <> bb          // only load the first bb

order by bb, aa;                            

DROP Table Area;

1.png