Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Ranking Questions - Further Ranking

  • mbates
  • mbates's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #185905 by mbates
Ranking Questions - Further Ranking was created by mbates
I'm a noob but loving LimeSurvey so far. Here is my question for the pros.

Ranking Question # 1 - Rank the following:

Red
Blue
Orange

(assume responses are ranked as follows)
Blue
Orange
Red

Ranking Question # 2 - Rank the following:

Dog
Cat
Giraffe

(assume responses are ranked as follows)
Giraffe
Cat
Dog

Ranking Question #3 - Rank the following:

Baseball
Football
Golf

(assume responses are ranked as follows)
Baseball
Golf
Football


Those first 3 questions are easy. Here is where I start having trouble.

Ranking Question #4 - Select your top preference from the following:

Dog (ranked #1 in Q1)
Giraffe (ranked #1 in Q2)
Baseball (ranked #1 in Q3)

(assume Baseball is selected)

Ranking Question #5 - Select your top preference from the following:

Dog (ranked #1 in Q1)
Giraffe (ranked #1 in Q2)
Golf (ranked #2 in Q3)

(assume Golf is selected)

Ranking Question #6 - Select your top preference from the following:

Dog (ranked #1 in Q1)
Giraffe (ranked #1 in Q2)
Football (ranked #3 in Q3)

How (if possible) would be the best way to do this? The available answers for 4,5 & 6 would need to be the top unused answers from the previous questions.

Any suggestions?

Thanks so much!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago - 4 years 9 months ago #185908 by Joffm
Replied by Joffm on topic Ranking Questions - Further Ranking
Hi,
I'd appreciate if you'd send an example of these question *.lss.

That makes it easier for us and for you, because we know which codes you used.

Therefore I only show for Q4. I use answer option codes "1", "2, "3"

answer option 1: {if(Q1_1==1,"Red",if(Q1_1==2,"Blue","Orange"))}
answer option 2: {if(Q2_1==1,"Dog",if(Q2_1==2,"Cat","Giraffe"))}
answer option 3: {if(Q3_1==1,"Basball",if(Q3_1==2,"Football","Golf"))}

Q5 and Q6 are analogue; but you have to consider which was used before and exclude it.



Here the result



Another approach could be to use a temporary hidden array(text) were you enter the result of the first three questions by equations.
Then Q4 uses the first row of this array, and afterwards the 1st ranked is removed from the array.
Q5 uses the first existing in each column, and afterwards the 1st ranked is removed from the array.
Q6 equal to Q5

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 9 months ago by Joffm.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago - 4 years 9 months ago #185918 by Joffm
Replied by Joffm on topic Ranking Questions - Further Ranking
Hi, mbates,
here is a working example.
I used the approach with a hidden array which you manipulate by some equation depending on the ranking.
I am rather sure that it was only an example ("red,blue,orange,....). So you have to adapt it to your real survey.
But I think it's straightforward and easy to understand. I only used the if-statement. Read about it in the manual and study some demo surveys ("I'm a noob but loving LimeSurvey so far.")

One more explanation:
In the answer table you will only see something like {AR_Y001_X002},
but the equations eqQ4a, eqQ5a and eqQ6a show which items were ranked.










Best regards
Joffm

File Attachment:

File Name: limesurvey...8757.lss
File Size:34 KB

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 9 months ago by Joffm.
The following user(s) said Thank You: mbates
The topic has been locked.
  • mbates
  • mbates's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #185923 by mbates
Replied by mbates on topic Ranking Questions - Further Ranking
Thank You so much! This is incredibly helpful and you are amazing, Sir.
The topic has been locked.
  • mbates
  • mbates's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #185926 by mbates
Replied by mbates on topic Ranking Questions - Further Ranking
As a follow up, is it possible to refer to an answer (such as A1 rather than "red") in the equation? That way, if the text answers are changed then the equation doesn't break. I tried by changing "red" in the equation to (A1) but I get an undefined variable error. Thanks again.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago - 4 years 9 months ago #185927 by Joffm
Replied by Joffm on topic Ranking Questions - Further Ranking
So you want to have it some kind of dynamically?
Why should it be necessary?

And you refer to the first eqation which fills the array, don't you?

Anyway, "A1" is absolutely wrong, because "A1" seems to be an answer option code, but not the code of a cell.
At least it is "Q1_A1". Bit as you say, it doesn't work.


Send your *.lss and we'll see.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 9 months ago by Joffm.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose