Creating a multiple response based on the previous Multiple selected
Posted: April 6th, 2023, 5:26 am
Hi Family,
This time round, I have a variable(Q1) with multiple selection and want to create another variable(Q2) but which should contain only the once that were selected in Q1. what do I do?
Q1(Select multiple)
A. YAM
B. Cassava...............selected
C. Maize,.................selected
D.. Millet
E. NONE
So I want in Q2 to have a preloaded options for those that were selected in Q1
I tried all the magic and went through documentation but still not getting it.
Q2(Multiple select)
A. Cassava
B. Maize
This is the logic that I used but did not succeed
Q2
preproc
valueset string vs1 = Q1_VS1;
do numeric i=1 while i<=length(Q1)
vs1.add(Q1[i:1]);
enddo;
setvalueset(Q2, vs1);
ERROR(6): Invalid function call (comma expected)
I will appreciate your support family.
This time round, I have a variable(Q1) with multiple selection and want to create another variable(Q2) but which should contain only the once that were selected in Q1. what do I do?
Q1(Select multiple)
A. YAM
B. Cassava...............selected
C. Maize,.................selected
D.. Millet
E. NONE
So I want in Q2 to have a preloaded options for those that were selected in Q1
I tried all the magic and went through documentation but still not getting it.
Q2(Multiple select)
A. Cassava
B. Maize
This is the logic that I used but did not succeed
Q2
preproc
valueset string vs1 = Q1_VS1;
do numeric i=1 while i<=length(Q1)
vs1.add(Q1[i:1]);
enddo;
setvalueset(Q2, vs1);
ERROR(6): Invalid function call (comma expected)
I will appreciate your support family.