Name Generation
-
- Posts: 33
- Joined: August 19th, 2023, 6:06 am
Name Generation
When i enter a name on this empty box in the picture.....
- Attachments
-
- 1.jpg (95.4 KiB) Viewed 6973 times
-
- Posts: 33
- Joined: August 19th, 2023, 6:06 am
Re: Name Generation
Name will be generated automatically in the option list........what will be the logic of this please can anyone tell me ?
- Attachments
-
- 2(Edit).jpg (472.19 KiB) Viewed 6972 times
-
- Posts: 152
- Joined: November 21st, 2022, 4:41 pm
Re: Name Generation
This logic is Dynamic Valuesets. In the preproc of the options list, you can add something like this code, found in the help documentation for the ValueSet Object. Rather than creating a new ValueSet object, you can also refer to an existing value set for the options list in your dictionary. Using valueset.add and setvalueset, you can change the options to include data based on the contents of NAME. In this example it is assumed that NAME is multiply occurring in a PERSON_REC record we can loop through to get all names.
Justin La Kier
PROC RESPONDENT
preproc
ValueSet respondent_valueset;
do numeric counter = 1 while counter <= count(PERSON_REC)
[/color]respondent_valueset.add(NAME(counter), counter);
enddo;
setvalueset(RESPONDENT, respondent_valueset);
Hope this helps,preproc
ValueSet respondent_valueset;
do numeric counter = 1 while counter <= count(PERSON_REC)
[/color]respondent_valueset.add(NAME(counter), counter);
enddo;
setvalueset(RESPONDENT, respondent_valueset);
Justin La Kier
-
- Posts: 33
- Joined: August 19th, 2023, 6:06 am
Re: Name Generation
can you do this with my Zip file i cant get it, please make the logic correct for me on "Module A1" name will be entered in "GU_A1_A2" section and option will be generated in "GU_A1_A6c" .....advance thank you!!
- Attachments
-
- Kent.Guardian.rar
- (62.06 KiB) Downloaded 324 times
-
- Posts: 33
- Joined: August 19th, 2023, 6:06 am
Re: Name Generation
What is the solution of it?
My Cspro version is 7.7.3
My Cspro version is 7.7.3
- Attachments
-
- Name.jpg (288.09 KiB) Viewed 6940 times
-
- Posts: 49
- Joined: October 15th, 2020, 3:40 am
Re: Name Generation
Valueset is used for numeric variable. Your var is string so you should used "Valueset string Respondent_valueset".
-
- Posts: 33
- Joined: August 19th, 2023, 6:06 am
Re: Name Generation
i cant make a solution.......can anyone please do for me with my zip file which is already uploaded earlier?
-
- Posts: 49
- Joined: October 15th, 2020, 3:40 am
Re: Name Generation
Try by changing your var from string to numeric.