Page 1 of 2

Entry according to number of household

Posted: March 16th, 2015, 7:47 am
by MrTaco
Hey Guys

I need the statement that can be able to allow only 2 or 5 people per row then skips to the next Q’s
If the household has 5 people I need a statement that will allow only 5 people and not allow not less or more...

I have uploaded the image for reference

Thanks in advance

Thabiso

Re: Entry according to number of household

Posted: March 17th, 2015, 1:31 pm
by josh
I'm not sure I understand what you are trying to do exactly. Is each row of the roster a person or a household? Are you trying to limit the number of rows in the roster? If that is the case then you may want to look at using the "occurence control field" in the roster properties. To use right click on the roster and choose properties and under occurrence control field enter the name (not label) of a variable in the dictionary that will be filled in before you get to the roster. CSPro will set the number of rows in the roster to the value of this variable. For example if I have a variable NUMBER_OF_PEOPLE_IN_HOUSEHOLD on my form before the roster of household members then I could use this as the occurrence control field.

Re: Entry according to number of household

Posted: March 18th, 2015, 2:29 am
by MrTaco
Hi, Josh

I normally use this block to select how many people I want to enter, so that I won’t have to go through all the entries to pass this section.
Example if I select 2 people I should be able to enter only those 2 people…
Refer to my code:

$=TOUPPER($);
if $=0 then $=missing; endgroup; endif;
if $ = 2 then skip to HS_11_1 endif;

this is the code i normally use but not on the roster table...

Thanks

Thabiso

Re: Entry according to number of household

Posted: March 18th, 2015, 5:59 am
by josh
If you don't want to use the roster control field then you can use the currocc() function to determine what row you are on in the roster and use endgroup to end the roster. For example if the roster looks like:

LINE_NUMBER | NAME| AGE| SEX | RELATIONSHIP

Then you could do the following in postproc of the last field in the row:

Code: Select all

PROC RELATIONSHIP
// End roster after entering 2 people
if currocc() = 2 then
  endgroup;
endif;

Complex Roster: Urgent

Posted: March 20th, 2015, 8:11 am
by MrTaco
Hi Guys

am hitting a rock here, how can i make a roster same as the file attached...

this roster is different to what am used to.

Thanks in advance

Thabiso

Re: Entry according to number of household

Posted: March 20th, 2015, 8:37 am
by josh
You can use the "veritical" setting in the drag options to make a roster like this.

Re: Entry according to number of household

Posted: March 20th, 2015, 8:47 am
by MrTaco
Thanks a Million Josh

Thabiso

Re: Entry according to number of household

Posted: March 21st, 2015, 12:02 pm
by Thabs
Hi Josh

I tried using the code you send me but am not winning

CODE: SELECT ALL
PROC RELATIONSHIP
// End roster after entering 2 people
if currocc() = 2 then
endgroup;
endif;

Please check the jpeg format i have uploaded

thanks

Re: Entry according to number of household

Posted: March 21st, 2015, 12:27 pm
by josh
Need more than a picture. What happens when you use the code? What do you want to happen?l

Re: Entry according to number of household

Posted: March 21st, 2015, 1:34 pm
by Thabs
example: let's say on the questionnaire theres 2 people in the household, i want to restrict according to number of people on each household
if it's 3 people it should only take three people or if it's 1 person it should take one person and skip to the next question.