Filter a multiple response based on the previous not selected choices
Posted: October 3rd, 2023, 8:13 pm
Hello community,
I'm trying to create multi select variable based on not selected choices of another multi select variable.
I read this viewtopic.php?t=5405 and tried to adapt the code as follows, but it did not work
Would you please help me out ?
I'm trying to create multi select variable based on not selected choices of another multi select variable.
I read this viewtopic.php?t=5405 and tried to adapt the code as follows, but it did not work
Code: Select all
PROC Q2
preproc
valueset string vs1;
do numeric i=1 while i<=length(strip(Q1))
if not ischecked(Q1[i:1], Q1) then
vs1.add(getlabel(Q1, Q1[i:1]), Q1[i:1]);
endif;
enddo;
setvalueset(Q2, vs1);