Create a variable based on a mapping of choices with external data | XM Community
Solved

Create a variable based on a mapping of choices with external data

  • 10 December 2018
  • 4 replies
  • 11 views

I have the following setup:

Subjects are asked from which state they are from and consecutively (Question "state"), based on their selection in "state", can choose from their more specific region in a question "region_x" where x indicates the state that was previously chosen, i.e. for each of the 20 states I have a different region-question, of which subjects only see the one that corresponds to their previous state-choice.

I now have a geographic variable, which is a bit more aggregate than "region", which I call "region2".
I also have a csv-file which maps all regions from "region" into the respective "region2".

I want to do this procedure:
1) Create a variable "region" which stores the choice from the respective "region_x" for each participant.
2) Create a second variable "region2" which stores the right aggregate region based on my csv-datafile.
3) Display the entry for "region2" in a later question "Q11" as part of the question text to the subject.

Is this possible in qualtrics? And if yes, does anybody has an idea how to do / approach this?

Any comment is highly appreciated.
icon

Best answer by TomG 10 December 2018, 17:15

View original

4 replies

Userlevel 7
Badge +33
Create a drill down question with 3 drop down state, region, region2 and upload your CSV. Later on in your next question you can pipe region2 selection.

https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/question-types-guide/specialty-questions/drill-down/
Thanks, that already helps a lot!
If I understand it correctly, the subject would see all three question then, right?

Ideally, I would want them to choose state and region, but region2 is somewhat confusing for subjects, so this should happen in the background, i.e. participants should not actively select it, but it should just "automatically" be assigned based on what they chose for region...

Is there a way to do this?
Userlevel 7
Badge +33
For this you have to write java script to punch region 2 as embedded variable.
Userlevel 7
Badge +27
@jjkecon,

After using a drill down to ask state/region, you can either use branches in the survey flow, JavaScript, or a web service to set a region2 embedded variable. With survey flow branches you would have one branch for each region2 and it would look something like:
```
Branch
if drilldown_question_region = region_X
or drilldown_question_region = region_Y
or drilldown_question_region = region_Z
Embedded data
region2 = region2_name
```

Leave a Reply