DUPLICATE CASES

Discussions about tabulating data in the designer or in batch mode
Post Reply
YFT_CBSD
Posts: 53
Joined: January 3rd, 2023, 12:36 am

DUPLICATE CASES

Post by YFT_CBSD »

Goodday, is there a way to count or show the caseid of the duplicate ID of a csdb?

For Example i have a csdb with 3 provinces on it and i want to count the duplicate case per provinces?

Thank you so much.
Gregory Martin
Posts: 1851
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: DUPLICATE CASES

Post by Gregory Martin »

You can use countcases: https://www.csprousers.org/help/CSPro/c ... ction.html

To specify duplicates, use CaseStatus.Duplicate: https://www.csprousers.org/help/CSPro/s ... ement.html

So something like:
countcases(DICT(CaseStatus.Duplicate) where PROVINCE = 1);
YFT_CBSD
Posts: 53
Joined: January 3rd, 2023, 12:36 am

Re: DUPLICATE CASES

Post by YFT_CBSD »

thanks, there's an error


Invalid function call(external dictionary name expected)



i forgot something, if possible can it be counted this way?

for example
**************************001
**************************002
**************************003
**************************004
**************************005
**************************005-duplicate
**************************006
**************************006-duplicate
**************************006-duplicate
**************************007
**************************007-duplicate
**************************007-duplicate
**************************007-duplicate

Total duplicate is 6.

Duplicates has blank values.
Gregory Martin
Posts: 1851
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: DUPLICATE CASES

Post by Gregory Martin »

When you use countcases with a universe, you can only use external dictionaries. Presumably you are trying to count the cases in your main dictionary. This is not possible.

The code I posted earlier will tell you how many duplicates, but it will count AA, BB, AA, AA , AA as 4 duplicates, and AA, BB, AA, BB also as 4 duplicates. If you want to treat the first as 1 duplicate and the second as 2 duplicates, you can use the keylist function and fill a list with the duplicates. You can then process this list yourself to determine how many unique duplicates there are.
YFT_CBSD
Posts: 53
Joined: January 3rd, 2023, 12:36 am

Re: DUPLICATE CASES

Post by YFT_CBSD »

Thank you so much.
Post Reply