Rank Array Totals & Provide Description by Top Ranked

Plus d'informations
il y a 4 ans 5 mois #120191 par 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:

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 4 ans 5 mois #120192 par 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120193 par 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120194 par 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?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120195 par 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120196 par 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.
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120198 par 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120199 par 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120201 par 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?
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120207 par 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois - il y a 4 ans 5 mois #120254 par 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?
Dernière édition: il y a 4 ans 5 mois par ccapra.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120266 par 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?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois - il y a 4 ans 5 mois #120272 par tpartner

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.


Assumptions:
- 4 Arrays with question codes q1, q2, q3 and q4
- You do not expect any of the array assessment totals to equal another array assessment total

This will give you the "total assessment value" for an array, question code q1:
{sum(that.q1.value)}

So, then you could create a new "Equation" type question (let's call it "maxVal") with the following equation. This will give the highest "total assessment value".
{max(sum(that.q1.value), sum(that.q2.value), sum(that.q3.value), sum(that.q4.value))}

Then you can use nested IFs to display variable text depending on which array matches the highest "total assessment value" (line-breaks inserted for clarity):
{if(q1 == maxVal, 'Text if q1 highest', 
	if(q2 == maxVal, 'Text if q2 highest', 
		if(q3 == maxVal, 'Text if q3 highest', 
			if(q4 == maxVal, 'Text if q4 highest', 
				'' 
))))}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Dernière édition: il y a 4 ans 5 mois par tpartner.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120354 par ccapra
Thanks! That all works beautifully!

So now, if there are two max scores, is there a way to give text for both? Like 'you are equally suited to Q1 and Q4' then 'text if q1' and 'text if q2'?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120359 par tpartner
Well, there may be a more elegant way but you could simply extend the nested IFs:
{if(q1 == maxVal, 'Text if q1 highest', 
	if(q2 == maxVal, 'Text if q2 highest', 
		if(q3 == maxVal, 'Text if q3 highest', 
			if(q4 == maxVal, 'Text if q4 highest', 
				if(q1 == maxVal AND q2 == maxVal, 'You are equally suited to Q1 and Q2', 
					if(q1 == maxVal AND q3 == maxVal, 'You are equally suited to Q1 and Q3', 
						if(q1 == maxVal AND q4 == maxVal, 'You are equally suited to Q1 and Q4', 
							if(q2 == maxVal AND q3 == maxVal, 'You are equally suited to Q2 and Q3', 
								if(q2 == maxVal AND q4 == maxVal, 'You are equally suited to Q2 and Q4', 
									if(q3 == maxVal AND q4 == maxVal, 'You are equally suited to Q3 and Q4', 
										''
))))))))))}

Or, perhaps several of those nested statements?


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!