- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
list two maximum values using expression manager
- lepsid
- Topic Author
- Offline
- New Member
Less
More
3 years 2 months ago #211899
by lepsid
list two maximum values using expression manager was created by lepsid
Hello.
I need some help with printing the two highest values out of five. I assume that max function can be used in expression manager. I know how to print one highest value, but I don't know how to print the second highest value.
For example,
using this code below, I can print the highest value
{if(A==max(A,B,C,D,E),"A","")}
{if(B==max(A,B,C,D,E),"B","")}
{if(C==max(A,B,C,D,E),"C","")}
{if(=max(A,B,C,D,E),"D","")}
{if(E==max(A,B,C,D,E),"E","")}
So, if the A is the highest value among A, B,C,D, and E, then A will be printed. But, I also want to define that the second highest value is also printed.
Is there any ideas or suggestions how to do it?
I need some help with printing the two highest values out of five. I assume that max function can be used in expression manager. I know how to print one highest value, but I don't know how to print the second highest value.
For example,
using this code below, I can print the highest value
{if(A==max(A,B,C,D,E),"A","")}
{if(B==max(A,B,C,D,E),"B","")}
{if(C==max(A,B,C,D,E),"C","")}
{if(=max(A,B,C,D,E),"D","")}
{if(E==max(A,B,C,D,E),"E","")}
So, if the A is the highest value among A, B,C,D, and E, then A will be printed. But, I also want to define that the second highest value is also printed.
Is there any ideas or suggestions how to do it?
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12912
- Thank you received: 3975
3 years 2 months ago #211900
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic list two maximum values using expression manager
Hi,
please read this
[url] forums.limesurvey.org/forum/can-i-do-thi...m-and-second-maximum [/url]
Joffm
please read this
[url] forums.limesurvey.org/forum/can-i-do-thi...m-and-second-maximum [/url]
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, lepsid
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
3 years 2 months ago #211905
by DenisChenu
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.
Replied by DenisChenu on topic list two maximum values using expression manager
@Joffm : excellent method !
Maybe find a good place in manual as "Expression sample survey" ?
manual.limesurvey.org/ExpressionScript_examples ?
Maybe find a good place in manual as "Expression sample survey" ?
manual.limesurvey.org/ExpressionScript_examples ?
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.