Show function and dynamic valueset

Discussions about CSEntry
Post Reply
htuser
Posts: 632
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Show function and dynamic valueset

Post by htuser »

Dear all,
I would like to know if it's possible to use previously entered response (name of persons in a household) in a dynamic valueset. The show function should do it if it allowed to choose some response in his windows. Gregory already post about similar, with setvalueset function. But the codes concerns previously entered using valueset, but for my situation, i would like to use non valueset field.
Thanks in advance,
G.VOLNY, a CSProuser from Haiti, since 2004
julianamurielo
Posts: 3
Joined: January 28th, 2015, 11:53 am

Re: Show function and dynamic valueset

Post by julianamurielo »

Dear all,

I would like to know if you have some help for the question made by htuser, because I am trying to do the same. Kindly see the attached (a questionnaire paper) to understand better my point.
First I have the household roster and then I have a question (4.2 in the example) that use the member ID to indicate who is the owner of the asset. But in the Android tablet I would like to have a value set with the names of household members and only check who are the owners.

Pd. Sorry for my English, i hope you understand and can help me.

Thank you in advance,
Attachments
CSPro_F1.docx
(677.42 KiB) Downloaded 314 times
htuser
Posts: 632
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Show function and dynamic valueset

Post by htuser »

Dear Juliana,
This problem is already solved by Josh. Please see codes below. If you have more specific problem, i can help you with a small example.

PROC GLOBAL
array codes(4);

array string labels(4);


PROC SURNAME_MEMBER2//is the roster you want to use the dynamic valueset for, using a reference roster, called SURNAME_MEMBER1, where, the surname where previously typed

preproc

codes(1) = 1;//, the number may be the number of the person in the reference roster, in your questionnaire, member ID

codes(2) = 2;

codes(3) = 3;

codes(4) = notappl; // mark end of array

labels(1) = SURNAME_MEMBER1(1);//SURNAME_MEMBER1 is the surname of the reference roster, in your questionnaire, 1.1, name of houshold members.

labels(2) = SURNAME_MEMBER1(2);

labels(3) = SURNAME_MEMBER1(3);

setvalueset(SURNAME_MEMBER2, codes, labels);
setcapturetype(SURNAME_MEMBER2,1);
set attributes(SURNAME_MEMBER2) assisted on (responses);

In this example, codes is the number of the person and SURNAME,his surname.

In this example, codes is the number of the person and SURNAME,his surname.

If you want to use only surname without codes, you must change/invert type:
array string labels(4);
array string codes(4)

and, in this event,
codes(i)=SURNAME_MEMBER1(1)

and

labels(i) = "";

where i varying from 1 to max (4 in this example)
Regards,
Last edited by htuser on January 28th, 2015, 5:56 pm, edited 1 time in total.
G.VOLNY, a CSProuser from Haiti, since 2004
julianamurielo
Posts: 3
Joined: January 28th, 2015, 11:53 am

Re: Show function and dynamic valueset

Post by julianamurielo »

Dear htuser,

Thanks for your reply. But I could not make this work. I don't know in what way should be the variable to which I want to put the names of household members as categories... I'll try to give you an example;

variable x = names of household members
variable y = who are the owners of the house?
  categories of variable y = I want that the names on variable x be show here and thus, the interviewer can choose from this list members who are the owners.

I really appreciate your help, I am a beginner user of CSPro

Best,
htuser
Posts: 632
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Show function and dynamic valueset

Post by htuser »

I'm waiting for your example for more help.
Regards,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply