Welcome to the LimeSurvey Community Forum

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

Calculate differnet types through questions

  • limehash
  • limehash's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago - 3 years 2 months ago #212592 by limehash
Hi,
I'm new to LS, but I already figured out, how to add values to answers and sum them up equotation ... sum(q1.value, q2.value)
But I need a survey, where the final result will be a summary page where the user is told (example):
you are 20% creative, 25% structured and 55% leader type.
So users will get different questions and each answer should add a value to one of these 3 different "working types". So my problem is, that I know, how to give points to answers and sum them all up together to ONE valu, but not how a specific answer can just add value to one of the thee types, so I get three different sums at the end.
Any idea is apprechiated.
Thanks!
Last edit: 3 years 2 months ago by DenisChenu. Reason: Remove url paste
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #212607 by holch
Hmmm, this might sound obvious, but how about creating an equation for each of the three types and calculate it this way? I don't see any other way around it.

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

The following user(s) said Thank You: limehash
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #212642 by Joffm
So each question either sums one of the types?
There are no questions that add something to type 1, if answered positively and add something to type 2 if answered negatively?
You seem to use assessment values.

Then it is easy:
First create three equations (one for each type) with
eqsum1 : {sum(Q1.valueNAOK,Q4.valueNAOK,Q7.valueNAOK,..)/MaximumPoints}
eqsum2 : {sum(Q2.valueNAOK,Q5.valueNAOK,Q8.valueNAOK,..)/MaximumPoints}
eqsum3 : {sum(Q3.valueNAOK,Q6.valueNAOK,Q9.valueNAOK,..)/MaximumPoints}

Now you have the percentages by each group.
You may reduce the total sum to 100 by next equations
eqtot1: {100*eqsum1/(sum(eqsum1,eqsum2,eqsum3)}
eqtot2: {100*eqsum2/(sum(eqsum1,eqsum2,eqsum3)}
eqtot3: {100*eqsum3/(sum(eqsum1,eqsum2,eqsum3)}
​​​​​​​
If you explain more detailled and send a lss export we can help better.
Maybe I misunderstood your idea.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: limehash
The topic has been locked.
  • limehash
  • limehash's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 1 month ago #212645 by limehash
Replied by limehash on topic Calculate differnet types through questions
So first of all, thank you both for your quick reply –I really apprechiate it.
You're both really close and your answers already helped me to do more research in the right direction. So maybe with an example, I can explain my problem better:

Example question: What happens to you, when you encounter unforeseeable situations in business?
a1: I get full of energy and like it (this would add +1 to "Leader")
a2: I try to avoid it, but I can manage it (would add +1 to "Manager")
a3: I get confused and mess it up (would add +1 to "Creative")

So at the end, I want to show the sums for "Leader", "Manager" and "Creative" (all of them).

Thanks in advance for your support.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #212649 by Joffm
Hi,
that's only a small variation
Use IF-statements
leader: sum(if(Q1=="a1",1,0),if(Q2=="a3",1,0),if(Q3=="a1",1,0),...
manager: sum(if(Q1=="a2",1,0),if(Q2=="a1",1,0),if(Q3=="a1",1,0),...
...

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, limehash
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #212650 by DenisChenu
Replied by DenisChenu on topic Calculate differnet types through questions
For information, i like to use this function for such system
Code:
{sum(
intval(Q1=="a1"),
intval(Q2=="a3"),
intval(Q3=="a1"),
intval(Q4=="a2"),
intval(Q5=="a4"),
0)

It can be easily done using a spreadsheet  tool

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: limehash
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #212658 by Joffm
Hi, Denis,
I knew, you showde this some time ago.
But did not find it.

Thanks
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #212661 by DenisChenu
Replied by DenisChenu on topic Calculate differnet types through questions
I know you know ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • limehash
  • limehash's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 1 month ago #212872 by limehash
Replied by limehash on topic Calculate differnet types through questions
Thank you guys for your support. It worked exactly like you said –so finally it was easy. :-)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose