I have a survey of students whereby I ask questions to find out which group they best belong in. Then, each group sees the question wording to determine their major that makes the most sense for those students. Therefore I have five questions capturing basically the same info (major), but each respondent only sees and answers one of them. I want to create an embedded data variable called major that draws on different questions depending on the person. So let's say, for a simple example:
Group / Question capturing major
1 / Q2
2 / Q3
3 / Q4
So I can easily set 3 embedded data variables such as major1, major2, major3 that is their answers to Q2, 3, and 4 respectively. But what I want to do is create an embedded data variable called major that is the answer to Q2 if you're in group 1, the answer to Q3 if you are in group 2, etc. That way I can pipe their major into subsequent questions by using that one single variable. (E.G. why did you choose to major in PIPE ANSWER?)
Alternatively, it would also work if I create various embedded data variables, but can pipe in either major1, major2, major3 to a single question later on.
Any help is much appreciated!
Thank you.
Page 1 / 1
If the "What is your Major?" question is the same question but with different choices based on Q1, then I would just adjust what options display based on Question 1. That should simplify the embedded data and also your overall survey data and analysis.
But to answer your question, you can set the embedded data of "major" three times with branching logic in your survey flow.
For example:
Brach If Q1 = Group 1
THEN Major = Response to Q2
Brach If Q1 = Group 2
THEN Major = Response to Q3
Brach If Q1 = Group 3
THEN Major = Response to Q4
Here's how that would look:
!
But to answer your question, you can set the embedded data of "major" three times with branching logic in your survey flow.
For example:
Brach If Q1 = Group 1
THEN Major = Response to Q2
Brach If Q1 = Group 2
THEN Major = Response to Q3
Brach If Q1 = Group 3
THEN Major = Response to Q4
Here's how that would look:
!
An easier way is to just concatenate the question answers of all five major questions into one variable because the answers to the questions that weren't answered will be blank, leaving you with just one value in your major variable. For example (if there were 3 major questions):
```
major = ${q://QID2/ChoiceGroup/SelectedChoices}${q://QID3/ChoiceGroup/SelectedChoices}${q://QID4/ChoiceGroup/SelectedChoices}
```
```
major = ${q://QID2/ChoiceGroup/SelectedChoices}${q://QID3/ChoiceGroup/SelectedChoices}${q://QID4/ChoiceGroup/SelectedChoices}
```
Thanks @TomG I tested that and it didn't work...but betting I had a typo (or extra space) that was causing issues.
> @MattBroffman_Orlando said:
> Thanks @TomG I tested that and it didn't work...but betting I had a typo (or extra space) that was causing issues.
You did it in a survey flow embedded data block, correct? Use the Piped Text menu to make sure you get the correct pipe string (including the correct QID).
> Thanks @TomG I tested that and it didn't work...but betting I had a typo (or extra space) that was causing issues.
You did it in a survey flow embedded data block, correct? Use the Piped Text menu to make sure you get the correct pipe string (including the correct QID).
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.