Page 1 of 1

Tablet repeating summary of previous case

Posted: February 25th, 2017, 4:09 pm
by Lasupo
Dear all,
I developed a household roster (CAPI) for listing in some Enumeration Areas in the country. In each of the these EAs, summary of total number of household members, number of buildings, number of members aged 15 - 49, etc. were calculated and saved("case accepted").

When we moved to another EA to "start a new case", all the summaries from previous EA is merged with this new EA.

The real question is: How do I empty (initialize to zero) all the contents of various variables used in the calculations so that this EA will have its own summary not in addition with the previous EA?

When the tablet is switched off before the new case is started, this issue will be eliminated. This method is not efficient enough.

Kindly assist me with codes to reset or initialize all previous calculations to zero (0) and new calculation begins and ends within each EA.

Urgently waiting for the usual assistance.

Many many thanks.
Lasupo

Re: Tablet repeating summary of previous case

Posted: February 26th, 2017, 10:55 am
by Saint
I guess we will need more details about how you are calculating the summaries to be able to help. If you can post the application (or at least the relevant part) then I can help out. There should be an easy fix.

Re: Tablet repeating summary of previous case

Posted: February 26th, 2017, 12:32 pm
by josh
As Saint said it is unclear exactly how you are doing the summary entry so it would help to have more details and see your application. Normally when you accept a case and start a new one all the dictionary variables for the main dictionary are reset to blank. However variables in external dictionaries and logic variables declared in proc GLOBAL will maintain their values.

If you are using variables from your main dictionary then you should not get any "merging" of old values. If you are using logic variables or external dictionaries then you can reset them in the preproc of the questionnaire. Logic in the preproc of the questionnaire is executed at the start of each new case. To reset a logic variable use an assignment statement (mynumericvariable = 0;) or (mystringvariable = "";). For external dictionaries you can use the clear function (clear(MYEXTERNALDICTIONARY)).