Skip Columns in Roster
Posted: February 21st, 2019, 11:35 am
Dear all,
after trying, reading and researching for 4 hours with no results, I need your help.
I have a roster:
With 7 columns for 7 different questions (1. number of men in the household (NUMBER_MEN), 2. number of women in the houshold, 3. total number of persons in the household (TOTAL_PERSONS), 4. disabilities of persons in the household, 5. number of men that work, 6. number of women that work, 7. number of women that are pregnant (WOMEN_PREGNANT)).
And 6 rows for 6 different age groups (a. less than 2 years, b. 2-5 years, 6-12 years, 13-17 years, 18-60 years, 61 years and more) and a 7th line for the total of each question.
What I already did is skipping questions for an age group with no men or women
--> if TOTAL_PERSONS= 0 then
skip to next;
endif;
Now, what I want to do is:
1) skip questions 5,6 and 7 for the age groups a. and b., and start with questions 1 for the next age group
2) skip question 7 for the age groups c. and f., and start with questions 1 for the next age group
For 1) I've tried:
preproc
//Skip to next age group for household members under 6 years of age
if TOTAL_PERSONS(1) > 1 then
skip to NUMBER_MEN(2);
endif;
if TOTAL_PERSONS(2) > 1 then
skip to NUMBER_MEN(3);
endif;
But this only works for row (2), then I get an error message because the program thinks in row (2) that it has to go back to row (2).
I also tried it using skip to next instead of NUMBER_MEN, but then CSPro skips all of the following questions 5 to 7 for every age group and not just for age group a. und b.
For 2) I've tried:
PROC WOMEN_PREGNANT
preproc
//Skip to next age group for women under 13 years of age
if NUMBER_WOMEN(3) > 1 then
skip to NUMBER_MEN(4);
endif;
if NUMBER_WOMEN(6) > 1 then
skip to NUMBER_MEN(7);
endif;
But it happens the same as above. I've also tried skip next instead of NUMBER_MEN. But once NUMBER_WOMEN(3)>1 is true, it skips this question in all of the following age groups
What can I do?
I would be super thankful for any help!
Greetings Nadine
after trying, reading and researching for 4 hours with no results, I need your help.
I have a roster:
With 7 columns for 7 different questions (1. number of men in the household (NUMBER_MEN), 2. number of women in the houshold, 3. total number of persons in the household (TOTAL_PERSONS), 4. disabilities of persons in the household, 5. number of men that work, 6. number of women that work, 7. number of women that are pregnant (WOMEN_PREGNANT)).
And 6 rows for 6 different age groups (a. less than 2 years, b. 2-5 years, 6-12 years, 13-17 years, 18-60 years, 61 years and more) and a 7th line for the total of each question.
What I already did is skipping questions for an age group with no men or women
--> if TOTAL_PERSONS= 0 then
skip to next;
endif;
Now, what I want to do is:
1) skip questions 5,6 and 7 for the age groups a. and b., and start with questions 1 for the next age group
2) skip question 7 for the age groups c. and f., and start with questions 1 for the next age group
For 1) I've tried:
preproc
//Skip to next age group for household members under 6 years of age
if TOTAL_PERSONS(1) > 1 then
skip to NUMBER_MEN(2);
endif;
if TOTAL_PERSONS(2) > 1 then
skip to NUMBER_MEN(3);
endif;
But this only works for row (2), then I get an error message because the program thinks in row (2) that it has to go back to row (2).
I also tried it using skip to next instead of NUMBER_MEN, but then CSPro skips all of the following questions 5 to 7 for every age group and not just for age group a. und b.
For 2) I've tried:
PROC WOMEN_PREGNANT
preproc
//Skip to next age group for women under 13 years of age
if NUMBER_WOMEN(3) > 1 then
skip to NUMBER_MEN(4);
endif;
if NUMBER_WOMEN(6) > 1 then
skip to NUMBER_MEN(7);
endif;
But it happens the same as above. I've also tried skip next instead of NUMBER_MEN. But once NUMBER_WOMEN(3)>1 is true, it skips this question in all of the following age groups
What can I do?
I would be super thankful for any help!
Greetings Nadine