Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
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
maxgro
MVP
MVP

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;