Page 1 of 1

DUPLICATE CASES

Posted: April 26th, 2023, 3:04 am
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.

Re: DUPLICATE CASES

Posted: April 26th, 2023, 8:56 am
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);

Re: DUPLICATE CASES

Posted: April 26th, 2023, 10:07 pm
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.

Re: DUPLICATE CASES

Posted: April 27th, 2023, 7:46 am
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.

Re: DUPLICATE CASES

Posted: April 27th, 2023, 9:58 pm
by YFT_CBSD
Thank you so much.