Welcome to the LimeSurvey Community Forum

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

Rank Array Totals & Provide Description by Top Ranked

  • ccapra
  • ccapra's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago #120191 by ccapra
I also asked this in the IRC Live Chat - is it uncool to ask in both places?

I have a survey with 4 question groups - each group has one Array question. Assessments are turned on. There are 8-11 subquestions in each array. Each sub-question in the array has 3 response options, the response options have values 0, 1, & 2.

I want to total the response values for each array, then rank the groups by those sums, and give a written summary depending on which group had the highest total. How do I do that?

:unsure:
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120192 by holch
You will need to learn how use the expression manager. If you look at the manual, it gives you a few examples on what you can do with the expression manager. You can create your own reports using text display questions.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120193 by holch
You will need to learn how use the expression manager. If you look at the manual, it gives you a few examples on what you can do with the expression manager. You can create your own reports using text display questions.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • ccapra
  • ccapra's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago #120194 by ccapra
Thanks @holch,

And I need more detail,

I have read the manual about Expression Manager - it's fairly sketchy.

From what I can tell, I need to use an equation for each group total - but I can't quite tell how to write that.

If my group array question is A1, and the responses are sq001-sq0011, how would I write the equation? And where would the result end up?

Then, if I do that in an equation question for each array, where & how would I create the ranking function?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120195 by holch
The expression manager manual isn't something you read in a few minutes and understand it. At the beginning it looks quite complicated, but once you tried some of the examples, you'll get a hang for it.

Well, you need to check how you can access the assements, which is explained here:
manual.limesurvey.org/Expression_Manager#Access_to_Variables

I would say it is something like A1_sq001.value.

So you might have to do something like this {resultA1 = A1_sq001.value + A1_sq002.value +...+ A1_sq011.value}

So resultA1 should have a sum of all assment values from sq001 to sq011 (of course you need to add the missing subquestions were "..." is).

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • ccapra
  • ccapra's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago #120196 by ccapra
When does that function run? i.e. when does the result show?

I'm just trying to figure out if I'm understanding the equation correctly, so I put {A1_SQ001.value}
I did activate the survey.

What I get is in the attached screenshot. I also attached a shot of the logic file for that question group as well.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120198 by holch
If you just want to show the value, you need to put {A1_SQ001.value}. I think "resultA1 = A1_sq001.value" will only work if you put it within {} and probably only in an equation type question.

If you just want to show the result for A1_SQ001, then you put {A1_SQ001.value} and it should show either 0, 1 or 2, depending on the question chosen.

The red highlight shows that there is a problem with "resultA1", because it is not allowed where you used it, I guess.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120199 by holch
Here you can find some examples on how to use expression manager, which will help to understand how it works:
manual.limesurvey.org/Expression_Manager_Examples

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • ccapra
  • ccapra's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago #120201 by ccapra
Ok, thanks. Making progress!

I inserted just {A1_SQ001.value} in the equation & that worked - so at least I'm on the right track:-)

So then I put in {resultA1 = A1_SQ001.value + A1_SQ002.value} based on your previous note (Just to test I'm doing it right before I write it all out for all the SQs.

But that doesn't work. Again I get an error message on the logic file - attached.

Can you see what I did wrong there?
Attachments:
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120207 by holch
Well, I am not 100% sure if this resultA1 = part works. What you could try is just put the sum part. That should give you the value of the sum, you just don't have a variable. But later you can use the question code of this equation question to calculate the sum of the various questions that you have.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • ccapra
  • ccapra's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago - 8 years 10 months ago #120254 by ccapra
Ok - so I used this {(A1_SQ001.value + A1_SQ002.value)} & it worked.

So now my question is, is there a way to rank the four results.

Say
A1_SQ001-SQ0011 (i.e. Q1) = 15
A2_SQ001-SQ0011 (i.e. Q2) = 28
A3_SQ001-SQ0011 (i.e. Q3) = 22
A4_SQ001-SQ0011 (i.e. Q4) = 31


I want to know which Q scored highest & say if Q-1 was highest show ...[description text], if Q-2 is highest show .... and so on. Is this possible? & how?
Last edit: 8 years 10 months ago by ccapra.
The topic has been locked.
  • ccapra
  • ccapra's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago #120266 by ccapra
OK - I ran into an issue & started a new topic #120264.

www.limesurvey.org/en/forum/design-issues/100307-equation-issue

But I still want to know how to rank the results of the 4 arrays & deliver a different text output depending on the highest storing section.

Can anyone help with that?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose