How do I recode a hidden variable based on a previous question? | XM Community
Solved

How do I recode a hidden variable based on a previous question?

  • 28 November 2019
  • 2 replies
  • 28 views

Userlevel 2
Badge +6
Hi,

I would like to grab the respondent's answer to the 'Which province/territories do you currently reside in?' and recode a hidden 'region' variable based on their response (e.g. British Columbia and Alberta are coded as West and Nova Scotia and PEI are coded as Atlantic and so on) . How do I implement this?

TIA
icon

Best answer by Anonymous 28 November 2019, 18:33

View original

2 replies

you can create embedded variable in survey flow and punch on basis of branch logic.
Userlevel 2
Badge +6
Do you have sample code? I have only been using Qualtrics for a week and we are transitioning from Confirmit.

Let's say Q1 is the province question and the answer selection plus their code is as follows:

0 - British Columbia
1 - Alberta
2 - Nova Scotia
3 - PEI

Q2 is the hidden region variable with:
1 - Atlantic
2 - West

How can I punch as 1 for Q2 if the respondent selects 2 or 3 at Q1?

Leave a Reply