Hi, I dug around a bit and I think there are a couple ways to go about this depending on the format the data needs to be in. The method I was able to put in place saves the rankings to embedded data fields and then uses piped text to display the rank order in a 2nd ranking question. The rank order from the 2nd question is then saved to embedded data fields. The data format will have the rank position as columns instead of the rank items.
To give it a try, first head to the Survey Flow and create the following Embedded Data fields:
Q1rank1
Q1rank2
Q1rank3
Q1rank4
Q1rank5
Q2rank1
Q2rank2
Q2rank3
Q2rank4
Q2rank5
Q1rankfinal
Q2rankfinal
Then, head over to the Builder and create 2 rank order questions with 5 options set to drag and drop. On the 1st question, add the below to the question's JavaScript. This was adapted from ahmedA's code in this post.
Qualtrics.SurveyEngine.addOnPageSubmit(function(){
var c="";
var x = this.getQuestionContainer().querySelectorAll("li");
for(i=0;i<x.length;i++){
var b = x[i].children[1].innerText;
c += x[i].children[1].innerText + ", ";
Qualtrics.SurveyEngine.setEmbeddedData("Q1rank"+(i+1),b);
}
c=c.slice(0, -2);
Qualtrics.SurveyEngine.setEmbeddedData("Q1rankfinal",c);
});
In the 2nd question, use the 'Edit Multiple' to set the answer options with the below:
${e://Field/Q1rank1}
${e://Field/Q1rank2}
${e://Field/Q1rank3}
${e://Field/Q1rank4}
${e://Field/Q1rank5}
Finally, add the below to the 2nd question's JavaScript:
Qualtrics.SurveyEngine.addOnPageSubmit(function(){
var c="";
var x = this.getQuestionContainer().querySelectorAll("li");
for(i=0;i<x.length;i++){
var b = x[i].children[1].innerText;
c += x[i].children[1].innerText + ", ";
Qualtrics.SurveyEngine.setEmbeddedData("Q2rank"+(i+1),b);
}
c=c.slice(0, -2);
Qualtrics.SurveyEngine.setEmbeddedData("Q2rankfinal",c);
});
--
To carry forward rank ordering where the data is in the default format so that each column is an item and the values are the rank position, TomG recommends in this post:
"If you use a Drag and Drop, you'll need to use JavaScript to put the choices in rank order. Pipe all the choices and ranks into your follow-up question, then rearrange the choices based on the ranks.
You can avoid JavaScript if you use a Text Box Rank Order question and set the default answers to the ranks in the first question."
TomG also has a custom function in that post that might assist there.
For JavaScript that uses the rankings of the 1st question to set the initial order of the rankings for the 2nd question, TomG has some code together in this stackoverflow post that does this but for sliders. The approach would be similar for another ranking question though I think, where the rankings from the 1st are piped into an array, sorted, and then the sorting is used to append the choices 1 at a time to the 2nd question in that order.