Page 1 of 1

Linking other sections of the dictionary with the roster

Posted: July 15th, 2017, 11:04 am
by Ayebian
Hello forum how can i link the roster with other sections of the dictionary

Re: Linking other sections of the dictionary with the roster

Posted: July 16th, 2017, 12:38 pm
by Gregory Martin
You'll have to post more details about what you're trying to do. What are you trying to link?

Re: Linking other sections of the dictionary with the roster

Posted: July 16th, 2017, 5:11 pm
by Ayebian
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

Re: Linking other sections of the dictionary with the roster

Posted: July 17th, 2017, 7:26 am
by josh
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)

Re: Linking other sections of the dictionary with the roster

Posted: July 25th, 2017, 3:00 am
by Ayebian
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

Re: Linking other sections of the dictionary with the roster

Posted: July 25th, 2017, 6:59 am
by khurshid.arshad
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.

Re: Linking other sections of the dictionary with the roster

Posted: July 26th, 2017, 3:55 am
by Ayebian
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

Re: Linking other sections of the dictionary with the roster

Posted: July 26th, 2017, 7:51 am
by sah
Hello,
can you share what you are doing so we can help out.

Re: Linking other sections of the dictionary with the roster

Posted: July 26th, 2017, 8:36 am
by josh
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).