Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Handling duplicate customers

Profile IDStatus1Status2CustId
780INPROGComplt100
88INPROGCancel200
789INPROGComplt200
800INPROGCancel300

The above table has  duplicate customer(200)  and two unique customers(100 & 300).

For Duplicates customer the Status would be taken as Status1

For Unique customers  the Status would be taken as Status2.

Please help me to get the below mentioned result.

Output:
Profile IDCustIdStatus
780100Complt
88200INPROG
789200INPROG
800300Cancel
1 Reply
MVP
MVP

Re: Handling duplicate customers

1.png



s2:

LOAD [Profile ID],

     Status1,

     Status2,

     CustId

FROM

[https://community.qlik.com/thread/196424]

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

Left Join (s2)

load CustId, count(CustId) as Cnt Resident s2 group by CustId;

final:

LOAD

  [Profile ID],

    if(Cnt>1, Status1, Status2) as Status,

//    Status1,

//    Status2,

    CustId

Resident s2;   

DROP Table s2;

Community Browser