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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to avoid duplicate records in qlikview

Hi Team,

Thanks in Advance,

I need help on below requirement.

Please find the attached document for the reference and how to implement in qlikview.

Thanks,

D

6 Replies
MK_QSL
MVP
MVP

LOAD ID,

     [update date1],

     type1

FROM

Book1.xlsx

(ooxml, embedded labels, header is 1 lines, table is Sheet1)

Where [update date1] <> '-';

Left Join

LOAD ID,

     [updated date2],

     type2

FROM

Book1.xlsx

(ooxml, embedded labels, header is 1 lines, table is Sheet1)

Where [updated date2] <> '-';

Not applicable
Author

Hi Manish,

Thanks for reply,

I was tried your code and getting below error:

Field not found<update date1> and <update date2>

Please help me on this

Regards,

D

Not applicable
Author

Hi,

Please find the attached script which I used it.

Regards,

D

its_anandrjs
Champion III
Champion III

Try to load like this

Tab1:

LOAD * INLINE [

    ID, update date1, updated date2, type1,  type2

    123, 3/12/2012, -, X, -

    123, -, 3/15/2012, , Y

    234, 4/20/2012, -, X, -

    234, -, 4/25/2012, , Y];

NoConcatenate

New:

LOAD

ID,

[update date1],

type1

Resident Tab1

Where [update date1] <> '-';

Left Join

LOAD

ID,

[updated date2],

type2

Resident Tab1

Where [updated date2] <> '-';

DROP Table Tab1;

And use correct field name from your source.

Regards

maxgro
MVP
MVP

If you want just a n ID by group, I think you can try with a simple group by

Tab1:

load ID,

  if(trim([update date1])='-', null(), [update date1]) as [update date1],

  if(trim([update date2])='-', null(), [update date2]) as [update date2],

  type1,

  type2;

LOAD * INLINE [

    ID, update date1, update date2, type1,  type2

    123, 12/03/2012, -, X, -

    123, -, 15/03/2012, , Y

    234, 20/04/2012, -, X, -

    234, -, 25/04/2012, , Y];

 

Tab:

NoConcatenate

load

  ID,

  Max([update date1]) as [update date1],

  Max([update date2]) as [update date2],

  MaxString(type1) as type1,

  MaxString(type2) as type2

Resident

  Tab1

Group by ID;

DROP Table Tab1;

MK_QSL
MVP
MVP

Check your Excel File. It may be possible, that the fieldname you have provided to us is different than your actual file...