Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to detect duplicate?

Employee                Status                         StatusId

Alex                         Submit                             A1

Alex                         Submit                              A2

Alice                         In progress                        B1

Jack                         Submit                              C1

Jack                         In progress                        C2

What formula should i use,I want to show If employee has more than one status then it is duplicate and show the duplicate id.

The result should be:

Employee   Status                          Duplicate ID

Alex           Duplicate                         A1,A2

Jack           Duplicate                         C1,C2

TQ

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Dimension : Employee

Expression :

Status ----- If(Count(Distinct StatusId)>1, 'Status')

Duplicate ID----- If(Count(Distinct StatusId)>1, Concat(StatusId, ','))

Hope this helps you.

Regards,

Jagan.

View solution in original post

10 Replies
SunilChauhan
Champion II
Champion II

see the attched file

hope this helps

Sunil Chauhan
sujeetsingh
Master III
Master III

Sunil has given you the sample file ..

Just use group by in qlikview script

Anonymous
Not applicable
Author

Hi,

Use group by Employee and get count(Status)>1

HTH

Ravi N.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Dimension : Employee

Expression :

Status ----- If(Count(Distinct StatusId)>1, 'Status')

Duplicate ID----- If(Count(Distinct StatusId)>1, Concat(StatusId, ','))

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

See the attachment hope it helps

anbu1984
Master III
Master III

Tab:

Load * inline [

Employee    ,            Status          ,               StatusId

Alex            ,             Submit     ,                        A1

Alex                 ,        Submit       ,                       A2

Alice               ,          In progress  ,                      B1

Jack                 ,        Submit      ,                        C1

Jack                  ,       In progress    ,                    C2

];

Final:

NoConcatenate

Load * Where Dup like '*,*';

Load Employee,'Duplicate' As Status,Concat(StatusId,',') As Dup Resident Tab Group by Employee;

Drop table Tab;

Not applicable
Author

try this

Not applicable
Author

try this

Status:-if(Count(DISTINCT StatusId)>1, 'duplicate',Concat(Status,','))

Duplicate Id:-if( count( distinct StatusId)>1, concat(StatusId,','),StatusId)

see the attachment

SunilChauhan
Champion II
Champion II

whats wrong with my attachedment?

Sunil Chauhan