Linking other sections of the dictionary with the roster

Discussions about CSEntry
Ayebian
Posts: 8
Joined: July 15th, 2017, 10:56 am

Linking other sections of the dictionary with the roster

Postby Ayebian » July 15th, 2017, 11:04 am

Hello forum how can i link the roster with other sections of the dictionary

Gregory Martin
Posts: 854
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Linking other sections of the dictionary with the roster

Postby Gregory Martin » July 16th, 2017, 12:38 pm

You'll have to post more details about what you're trying to do. What are you trying to link?

Ayebian
Posts: 8
Joined: July 15th, 2017, 10:56 am

Re: Linking other sections of the dictionary with the roster

Postby Ayebian » July 16th, 2017, 5:11 pm

Helo gregory thanks for the reply,i created a house hold roster listing all family members and their details in section A,now they are questions in other sections like the health section it starts with"who is responding to this section" i want the application to be able to bring a list of the members of the roster..also in the education section ther is a check for age(for members 10years and above) but age is in the roster..so i want other sections to be able to connect with the roster..thank you

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

Re: Linking other sections of the dictionary with the roster

Postby josh » July 17th, 2017, 7:26 am

One way to do this is to use what call dynamic value sets. Instead of having the values in the value set fixed in the dictionary you can set them in your program logic using the setvalueset function to the names of the household members. This takes a little bit of programming but it is a very useful technique in this and other situations. For examples of this see the following:

CAPI Getting Started Guide:
https://www.census.gov/population/inter ... tarted.pdf

Lecture notes on dynamic value sets (look on page 8) that uses values from roster:
http://teleyah.com/cspro/SouthAfricaOct2016/05-CAPI.pdf
http://teleyah.com/cspro/SouthAfricaOct ... apter5.zip (example application that accompanies above)

Ayebian
Posts: 8
Joined: July 15th, 2017, 10:56 am

Re: Linking other sections of the dictionary with the roster

Postby Ayebian » July 25th, 2017, 3:00 am

mr josh thanks the response but i dont have a fixed list of house hold members..i want section A to list them and other sections will refe to the listed members

khurshid.arshad
Posts: 249
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan
Contact:

Re: Linking other sections of the dictionary with the roster

Postby khurshid.arshad » July 25th, 2017, 6:59 am

Dear Ayebian

Please use this code to view the household member list. You can amend based on your requirement.


You can view all male members from age 15 to 45

Code: Select all

j = count(PID where Age >=15 and Age <=45 and Gender =1 );

   do i=0 until i=j+1
      numeric seekpid=seek(PID where Age >=15 and Age <=45 and Gender =1, @i+1);
      
      if seekpid>0 then
         codes(i) = PID(seekpid);
         labels(i) = NAME(seekpid);
      else
      endif;
   
   
   enddo;
      codes(i-1)=notappl;   
      setvalueset($, codes, labels);



a.

Ayebian
Posts: 8
Joined: July 15th, 2017, 10:56 am

Re: Linking other sections of the dictionary with the roster

Postby Ayebian » July 26th, 2017, 3:55 am

hello..i think if you can share a video link that would help better because I don't understand what "I","J" stand for..thank you

sah
Posts: 77
Joined: May 28th, 2015, 3:16 pm

Re: Linking other sections of the dictionary with the roster

Postby sah » July 26th, 2017, 7:51 am

Hello,
can you share what you are doing so we can help out.

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

Re: Linking other sections of the dictionary with the roster

Postby josh » July 26th, 2017, 8:36 am

If you look at the example I posted links to in my earlier reply you will see that the household roster there is not fixed either. Using dynamic value sets (setvalueset) allows you to change the responses at run-time to reflect the list of household members entered in an earlier section. To do this you will have to write logic similar to what is in the example I posted (which is also similar to the logic that @khurshid.arshad posted).


Return to “Entry”