Entry according to number of household

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Entry according to number of household

Post 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
Attachments
Roster.png
Roster.png (172.82 KiB) Viewed 12711 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Entry according to number of household

Post 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.
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Entry according to number of household

Post 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
Attachments
household schedule.png
household schedule.png (185.24 KiB) Viewed 12699 times
Number.png
Number.png (154.71 KiB) Viewed 12699 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Entry according to number of household

Post 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;
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Complex Roster: Urgent

Post 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
Attachments
Complex Roster.png
Complex Roster.png (42.05 KiB) Viewed 12688 times
This is how I normally do
This is how I normally do
Complex Roster.png (9 KiB) Viewed 12688 times
Last edited by MrTaco on March 20th, 2015, 8:46 am, edited 2 times in total.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Entry according to number of household

Post by josh »

You can use the "veritical" setting in the drag options to make a roster like this.
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Entry according to number of household

Post by MrTaco »

Thanks a Million Josh

Thabiso
Thabs
Posts: 3
Joined: November 24th, 2014, 11:58 am

Re: Entry according to number of household

Post 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
Attachments
Restrict number of person.png
Restrict number of person.png (77.9 KiB) Viewed 12682 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Entry according to number of household

Post by josh »

Need more than a picture. What happens when you use the code? What do you want to happen?l
Thabs
Posts: 3
Joined: November 24th, 2014, 11:58 am

Re: Entry according to number of household

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