Tablet repeating summary of previous case

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
Lasupo
Posts: 6
Joined: July 15th, 2016, 4:07 pm

Tablet repeating summary of previous case

Post 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
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: Tablet repeating summary of previous case

Post 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.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Tablet repeating summary of previous case

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