Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Fuction Distinct

Hi,

I would like to know how eliminate duplicates into my table (RUT);

I have this;

Temp:

LOAD

RowNo() as ID,

  PERSON_ID,

     NUMBER_ID as RUT,

     NAME_ as NOMBRE,

     MASK

FROM

  $(RutaQlikviewQvd)Ruta.QVD(qvd)

WHERE

  EXISTS(PERSON_ID);

GE_PERSONS:

LOAD 

  ID,

  PERSON_ID,

      Count(Distinct RUT) as Rut,

     NOMBRE,

     MASK

     Resident Temp

     WHERE

  EXISTS(PERSON_ID);

  Drop Table Temp;

Still appears the duplicates,

Thank you for your help.

10 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Try this

GE_PERSONS:

LOAD DISTINCT

  ID,

  PERSON_ID,

     RUT as Rut,

     NOMBRE,

     MASK

     Resident Temp

     WHERE

  EXISTS(PERSON_ID);

pgalvezt
Specialist
Specialist
Author

Hi, thank you for you reply, I already tried before. But Doesn't work.

pgalvezt
Specialist
Specialist
Author

Or if you have another way to do this. I would appreciate.

Thanks

jjordaan
Partner - Specialist
Partner - Specialist

Hi Pablo,

I would expect it should work celambarasan said.

Maybe you can try something with previous function;

Temp:

LOAD

RowNo() as ID,

  PERSON_ID,

     NUMBER_ID as RUT,

     NAME_ as NOMBRE,

     MASK

FROM

  $(RutaQlikviewQvd)Ruta.QVD(qvd)

WHERE

  EXISTS(PERSON_ID);

GE_PERSONS:

LOAD

  ID,

  PERSON_ID,

  IF(RUT = Previous(RUT), 1,0),

     NOMBRE,

     MASK

Resident Temp

ORDER BY RUT

     WHERE RUT = Previous(RUT);

  Drop Table Temp;

pgalvezt
Specialist
Specialist
Author

Gave an error

Unrecognized words after the sentence. (This happened with the Where Sentence)

But when I take off the where sentence QlikView Load well. But still with duplicates rut.

Thank you.

jjordaan
Partner - Specialist
Partner - Specialist

ORDER BY and WHERE must turned arround.

Resident Temp

WHERE RUT = Previous(RUT)

ORDER BY RUT asc;

pgalvezt
Specialist
Specialist
Author

Still Appears Duplicate Rut's

I Attached the image.

jjordaan
Partner - Specialist
Partner - Specialist

So but try this

GE_PERSONS:

LOAD

  ID,

  PERSON_ID,

  IF(RUT = Previous(RUT), 1,0),

     NOMBRE,

     MASK

Resident Temp

ORDER BY RUT

     WHERE RUT <> Previous(RUT);

  Drop Table Temp;

CELAMBARASAN
Partner - Champion
Partner - Champion

Could you post the sanple duplicate data?

Need to know how it look like