changing one record from a questionnaire to another

Discussions about editing and cleaning data
Post Reply
AriSilva
Posts: 595
Joined: July 22nd, 2016, 3:55 pm

changing one record from a questionnaire to another

Post 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?
Best
Ari
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: changing one record from a questionnaire to another

Post 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
AriSilva
Posts: 595
Joined: July 22nd, 2016, 3:55 pm

Re: changing one record from a questionnaire to another

Post 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?
Best
Ari
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: changing one record from a questionnaire to another

Post 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
Post Reply