Hoe to recode - i.e. create a new variable from two or more existing variables | XM Community
Skip to main content

edit: SORRY FOR THE TYPO

 

Hello,

 

Hidden autofills appear too complicated for me, so how about a recode like below? How could one go about getting a new variable/column in your data set based on the following:

 

QS2a - multiple choice
a) Apple
b) Banana
c) Coconut
d) Dragonfruit

QS2b - single choice (and only shown if multiple answers at QS2a)
a) Apple
b) Banana
c) Coconut
d) Dragonfruit

I want a recode (call it RQS2b) where
(QS2a = Apple AND QS2b = blank) OR QS2b = Apple, then RQS2b = Apple
(QS2a = Banana AND QS2b = blank) OR QS2b = Banana, then RQS2b = Banana
(QS2a = Coconut AND QS2b = blank) OR QS2b = Coconut, then RQS2b = Coconut
(QS2a = Dragonfruit AND QS2b = blank) OR QS2b = Dragonfruit, then RQS2b = Dragonfruit

Please please help if you can. QS2a and QS2b exist in my survey, but RQS2b is just theoretical and what I want to create.

hi @Stefan_LP you can build such logic in the survey flow and then create an embedded data “RQS2b” where the value will be stored.

this if for apples, you can repeat the same for other fruits as well.

 


Leave a Reply