Error in sum of values in two different forms

Discussions about CSEntry
Post Reply
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Error in sum of values in two different forms

Post by PHINOJOSA »

Hello, I have a problem my form has 2 stages PASADA1 and PASADA2, but when I do PASADA1 it only advances to where it corresponds (A2), the problem happens when I do PASADA2I need the value of PASADA1 (A1 AND A2) that is in a field gray and does not allow me to do the sum (SUM1 AND SUM 2.

recreate a small example of the 2 stages. I cannot pull the value of PASADA1 and add it in the questionnaire of PASADA2.

PROC GLOBAL

PROC PRUEBA01_FF

PROC TIPO
if TIPO = 1 then
skip to ID;
else
skip to B1;
ENDIF;

PROC A2
if A2 > 0 then
endlevel;
endif;

PROC SUMA1
preproc
SUMA1 = A1 + B1;

PROC SUMA2
preproc
SUMA2 = A2 + B2;


I hope you can help me thank you very much
Attachments
CSPRO_RROR_SUM.jpg
CSPRO_RROR_SUM.jpg (71.14 KiB) Viewed 3885 times
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Error in sum of values in two different forms

Post by sherrell »

You're doing a few questionable things.

[1] Is ID an identification field? If so, it should never be skipped.
[2] In PROC A2, you're always ending the case if the value is greater than 0. So you'll never reach the second form corresponding to the second stage.
[3] Since you're skipping A1 & A2 if TIPO=2, there's of course no data to retrieve from there when doing your summations on the second form.

Is the data on these forms being collected at the same time or separate times?

Sherrell
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Error in sum of values in two different forms

Post by PHINOJOSA »

hello sherrell

Thank you very much for answering, if I understand the ID, it's just an example so you could understand my problem.

I am preparing a survey in which, at first, a record is made at the dwelling level and in each dwelling it is asked if women between the ages of 20 and 40 live in that dwelling, and if women of that age range live in that dwelling, it is asked if they are present? and if it is present, the information of each woman is collected but sometimes at the time of registration not all of them are there but only 1, so I must return the next day and continue with the information of the other women in a roster and what I want do is for example:

4 women live in house 1, but at that moment only 2 are present, and these 2 women are registered in the roster.
the next day the other 2 women meet and what I want is to add 2 + 2 so that when the roster reaches 4 it goes to the next form, that's why I want to add different forms that will be many times at 2 different times, I would really appreciate it if you can help me.



Atte.
Paul Hinojosa
Attachments
Sum.rar
(6.56 KiB) Downloaded 78 times
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Error in sum of values in two different forms

Post by sherrell »

Hi Paul,

>4 women live in house 1, but at that moment only 2 are present, and these 2 women are registered in the roster.

I don't see a roster in your application, and neither of the two records in your dictionary repeat. Is there more to this application than what you sent? For I can understand what you want to do, but what you sent doesn't seem to bear any resemblance to it.

You would basically just want a record that contains all the information you want from each woman, and the record should repeat. You would have a filter question, something along the lines of "Is Woman X available to interview now?" If she isn't, skip over those questions and move on to the next woman. When you return to the HH to complete the interview, for any woman who answered NO earlier you would re-ask if they are available. If they are, you'd finish their interview. For the other women, you could either skip their data entirely, or ask if the interviewer wants to confirm any of the data, etc.

Sherrell
Post Reply