Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Prabhu1204
Creator
Creator

Duplicate records

@jagan 

Hello All,

How to find the duplicate

When the ID1 & ID2 combination repeats same then the record to be markes as duplicate

for example in the below attached file  the second and Third row value of XRAY should be marked as duplicate

Prabhu1204_0-1656686451377.png

 

expected Outuput:

 

Prabhu1204_1-1656686496045.png

 

 

Thanks in Advance

 

-Prabhu
Labels (1)
2 Solutions

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@Prabhu1204  Please use the below Script:

NoConcatenate
Temp:
Load * Inline [
ID1, ID2, Value1
XRAY, 6768,100
XRAY, 6768,100
XRAY, 6768,100
XRAY, 6768,100
STA,897,100
STA,897,100
STA,897,100
];

NoConcatenate
Temp1:
Load *,
if(ID2=Peek(ID2),'Duplicate','Not Duplicate') as Condition
Resident Temp;

Drop table Temp;

Exit Script;

View solution in original post

MarcoWedel

maybe one solution could be:

MarcoWedel_0-1656709863171.png

 

table1:
LOAD RecNo() as RecNo, *,
     ID1&ID2 as ID12,
     If(Exists(ID12, ID1&ID2),'Duplicate','Non Duplicate') as Flag
Inline [
ID1, ID2, Value
XRAY, 6768, 100
XRAY, 6768, 100
XRAY, 6768, 100
XRAY, 6768, 100
STA, 897, 100
STA, 897, 100
STA, 897, 100
ABC, 123, 100
ABC, 123, 100
XRAY, 6768, 100
STA, 897, 100
];

DROP Field ID12;

View solution in original post

2 Replies
sidhiq91
Specialist II
Specialist II

@Prabhu1204  Please use the below Script:

NoConcatenate
Temp:
Load * Inline [
ID1, ID2, Value1
XRAY, 6768,100
XRAY, 6768,100
XRAY, 6768,100
XRAY, 6768,100
STA,897,100
STA,897,100
STA,897,100
];

NoConcatenate
Temp1:
Load *,
if(ID2=Peek(ID2),'Duplicate','Not Duplicate') as Condition
Resident Temp;

Drop table Temp;

Exit Script;

MarcoWedel

maybe one solution could be:

MarcoWedel_0-1656709863171.png

 

table1:
LOAD RecNo() as RecNo, *,
     ID1&ID2 as ID12,
     If(Exists(ID12, ID1&ID2),'Duplicate','Non Duplicate') as Flag
Inline [
ID1, ID2, Value
XRAY, 6768, 100
XRAY, 6768, 100
XRAY, 6768, 100
XRAY, 6768, 100
STA, 897, 100
STA, 897, 100
STA, 897, 100
ABC, 123, 100
ABC, 123, 100
XRAY, 6768, 100
STA, 897, 100
];

DROP Field ID12;