Ranking values imputed through embedded data? | XM Community
Skip to main content

Hi,
I am trying to:
a) have people make a series of decisions for 10 things that creates ten pieces of embedded data (let's call them: value1, value2, value3, value4,...,value10) for those things,
b) rank order value 1 through value 10 (without having participants do a ranking question), breaking ties randomly,
c) pipe in the values based on whether they are ranked highest/middle/lowest.
Is there a simplistic way to do this?

I assume each thing has a value. It probably doesn't meet your definition of simplistic, but you can pipe the things and values into a JS array of objects, sort them, then display them in sorted order in categories (high/medium/low).


Thanks Tom! Is there an easy set of javascript that would sort embedded data with numeric values titled thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9,thing10?


var things = [
{name:'thing1',value:parseInt("${e://Field/thing1}"},
{name:'thing2',value:parseInt("${e://Field/thing2}"},
{name:'thing3',value:parseInt("${e://Field/thing3}"}
];

things.sort(function (a,b) {return b.value - a.value;}); //highest to lowest


Thanks for helping!


Leave a Reply