Entry according to number of household

Other discussions about CSPro
josh
Posts: 1653
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Entry according to number of household

Postby josh » March 23rd, 2015, 7:14 am

And what happens when you try the code that uses currocc?

Really the roster control is the simplest solution though. I'm not sure why you don't want to use that.

MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Entry according to number of household

Postby MrTaco » March 23rd, 2015, 8:30 am

The issue is that if I use a roster control, it won't work coz all the questionnaires are not having the same number of people in the household.

when i use the code it says " Compile failed" on the Logic View

josh
Posts: 1653
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Entry according to number of household

Postby josh » March 23rd, 2015, 5:21 pm

The occurrence control field of the roster lets you have a different number of rows in the roster for each questionnaire. You create a variable in your dictionary for number of people in the household and set that variable as the occurrence control field. Then when keying in a household you enter the number of people for that household and the number of rows of the roster is adjusted automaticaly.

On the compile error, this probably a typo or a missing semicolon or something. Check the spelling of curocc(). I often put in the wrong number of r's or c's.

MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Entry according to number of household

Postby MrTaco » March 24th, 2015, 5:32 am

Hi Josh

Can you please add the code for me

find the attached file

Thanks
Attachments
Restricted Household Roster.zip
(3.47 KiB) Downloaded 137 times

josh
Posts: 1653
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Entry according to number of household

Postby josh » March 24th, 2015, 7:18 am

Here are the two options - with occurrence control field and with logic.
Attachments
Restricted Household Roster - logic.zip
Version using if and curocc() in logic (look at proc for race)
(3.83 KiB) Downloaded 164 times
Restricted Household Roster - occurence control field.zip
Version using occurence control field (look at roster properties)
(3.73 KiB) Downloaded 170 times

MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Entry according to number of household

Postby MrTaco » March 24th, 2015, 8:12 am

Thank you Josh...

That's what I wanted

mclaren11
Posts: 10
Joined: November 20th, 2016, 11:31 am

Re: Entry according to number of household

Postby mclaren11 » November 26th, 2016, 9:08 am

I'm not certain I comprehend what you are attempting to do precisely. Is every line of the list a man or a family unit? Is it true that you are attempting to confine the quantity of lines in the list? On the off chance that that is the situation then you might need to take a gander at utilizing the "occurence control field" in the list properties. To utilize right tap on the list and pick properties and under event control field enter the name (not name) of a variable in the word reference that will be filled in before you get to the list. CSPro will set the quantity of lines in the program to the estimation of this variable. For instance in the event that I have a variable NUMBER_OF_PEOPLE_IN_HOUSEHOLD on my frame before the list of family individuals then I could utilize this as the event control field.

miyinzi
Posts: 1
Joined: September 11th, 2016, 5:36 am

Re: Entry according to number of household

Postby miyinzi » November 8th, 2018, 1:53 am

Dear Good People,

Can someone share a code that will enable me to implement a dynamic loop such that if a household has five members, only five rows appears and so on. Thanks. :)

aaronw
Posts: 104
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Entry according to number of household

Postby aaronw » November 8th, 2018, 4:39 pm

Take a look at the example projects Josh has already provided that demonstrate how to restrict the number of rows shown in a roster. One uses logic and the other uses a property called the occurrence control field.


Return to “Other”