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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
MarioCenteno
Creator III
Creator III

Skip duplicate data in counting

Hello everyone, I need to make a condition that discards duplicate data once you find a correct data, the data may be correct or wrong but when there is a correct data that omits the wrong data.

I have 409 records with duplicate data, I want to omit the duplicate data when I find a correct data and stop counting it.

 

qlik.png

1 Solution

Accepted Solutions
MarioCenteno
Creator III
Creator III
Author

I have solved the problem using a CASE WHEN 🙂

 

and 1 = case when call_status ='Failed' and (SELECT count(*)
FROM PRIME.CALLSLOG z
where z.noins = t.noins
and trunc(z.datetime_stamp) = trunc(c.datetime_stamp)
and z.call_status ='Successful'
) > 0 then 0
when call_status ='Successful' then 1
when call_status ='Failed' and (SELECT count(*)
FROM PRIME.CALLSLOG z
where z.noins = t.noins
and trunc(z.datetime_stamp) = trunc(c.datetime_stamp)
and z.call_status ='Successful'
) =0 then 1
else 0
end

View solution in original post

2 Replies
JustinDallas
Specialist III
Specialist III

Is there a way we could get some sample data that illustrates the problem?

MarioCenteno
Creator III
Creator III
Author

I have solved the problem using a CASE WHEN 🙂

 

and 1 = case when call_status ='Failed' and (SELECT count(*)
FROM PRIME.CALLSLOG z
where z.noins = t.noins
and trunc(z.datetime_stamp) = trunc(c.datetime_stamp)
and z.call_status ='Successful'
) > 0 then 0
when call_status ='Successful' then 1
when call_status ='Failed' and (SELECT count(*)
FROM PRIME.CALLSLOG z
where z.noins = t.noins
and trunc(z.datetime_stamp) = trunc(c.datetime_stamp)
and z.call_status ='Successful'
) =0 then 1
else 0
end