is this possible to create this SAS code in Qualtrics? | XM Community
Skip to main content

if J5a in (0,2,3,4) and J5b in (0,1,2,3,4) then do:
if J5a=0 then pain =0;
else if J5a in (1, 2) then pain=1;
else if J5a = 3 then do;
if J5b in (0,1,2) then pain = 2;
else if J5b = 3 then pain=3;
else if J5b= 4 then pain=4;

Hi mziraldo is this something you MUST have done via "code" or is it acceptable to be able to set the values based on survey flow, dynamically as the survey is processing their responses? If the latter, you would probably use a combination of branch logic and embedded data fields to accomplish this:
image.pngNote that you would want to think about every combination (your example didn't describe how to flow from QJ5A=4 but hopefully this example gives you an idea).


This is code from SAS and I wonder if I can replicate it in Qualtrics.


Leave a Reply