Page 1 of 1

Mobile number/Phone number duplication Check

Posted: January 18th, 2016, 6:36 am
by Jamal Hossain
Hi
Duplication of Record number/ Respondent Id checks automatically executes in id items.
Now I need another checks for Mobile/Phone number which should be unique for each respondents. "contract_no" are located under another record and is alpha(11).
Please help/suggest on the issues.

Thanks
Jamal

Re: Mobile number/Phone number duplication Check

Posted: January 18th, 2016, 6:41 am
by Jamal Hossain
Please note: mobile numbers are 11 digit & leading 0
01714207472
01714207477
01714207478
01714207479 etc.

Please note: Land Phone numbers are 7 digits
9128201
9128202
9128203
9128204 etc.

both will be entered in "contact_no" .

Re: Mobile number/Phone number duplication Check

Posted: January 19th, 2016, 7:05 am
by josh
Only the id items are checked for duplicates by CSPro and it is only the entirety of the id items that is checked, not each field. In other words, if you have 3 id items A, B and C you can have two cases that have the same value for A as long as they have different values for B and C. This means that if you want CSPro to check the uniqueness of the phone number across multiple cases (multiple questionnaires) you would need to make that the only id item.

The alternative is to write logic to do this yourself but this is tricky. CSPro does not let you load the values from other cases in the main data file so if you are entering data for questionnaire 10 you cannot lookup the phone number of questionnaire 1. You would have to write the phone numbers for each respondent to an external file and then use that to check to see if the phone number had been used in a previous questionnaire. You would create an external dictionary with the phone number as the id item. When a phone number is entered you would use loadcase() to see if the phone number had been used before. If not you would use writecase() to save that phone number to the external file.