Page 1 of 1

changing one record from a questionnaire to another

Posted: December 20th, 2023, 9:27 am
by AriSilva
Hi folks,
Suppose I have a file with two record types: hosehold (single record) and person (multiple records), and an ID with, lets say, length 6.
Is there a way to "move" one specific person, lets say person 3, from one questionnaire to another questonnaire?

Re: changing one record from a questionnaire to another

Posted: December 21st, 2023, 12:46 pm
by justinlakier
Hi,

This can be done in Data Entry or Batch Edit logic. Set the fields of the latter record to copy the information of the person from the former record, then you can remove the person's information from the fields of the former record. If you wanted to move person 3 from Household to Person records as in your example, you could put logic in the preproc of Person which sets these values if it finds person 3's data in the Household record.

Hope that helps,
Justin

Re: changing one record from a questionnaire to another

Posted: December 21st, 2023, 1:07 pm
by AriSilva
Thank you for your tip.
Could you be more specific when you mention "put logic in the preproc"?
Do I have to copy each variable one by one?
In batch processing, how do I copy the speccific person record, and how do I save it in a later questionnaire, supposing the source questionnaire comes before the target questionnaire. And if it comes later?

Re: changing one record from a questionnaire to another

Posted: December 26th, 2023, 3:49 pm
by justinlakier
Hi,

The way to do this is to go in Batch Edits and just copy each variable one by one.
So, the logic would be something like "targetVariable = sourceVariable;" for each variable in the record. Setting variables one by one would be how you save it to the target questionnaire. You can locate the specific person record you want to copy over in batch edit by putting the above logic in something like "if NAME=toCopy then" so that only the specific person's record and data is copied over. Supposing the source questionnaire comes before the target questionnaire, you would put the logic setting the target fields in the target procs. If the source questionnaire came after the target questionnaire, you could set the target variables from the procs of the source questionnaire.
But yes, there is no way to move records, you can only copy going variable by variable in batch edit.

Hope this helps,
Justin