0

I have four formula type questions in a LimeSurvey were the resultants are integers

e.g

Q-1=23  Q-4=19  Q-7=45  Q-9=24

I need to find the greatest number and its related question #

In this case the greatest # is 45 and the question # is Q-7

I have been reading the Expression Manager documentation but am having no luck

Thank you

4

1 回答 1

2

好吧,如果您的问题代码中有连字符,那么您必须使用过时的 LimeSurvey 版本。此解决方案适用于当前版本(2.05),并假设公式问题中不能有重复...

为简单起见,让我们给您的公式问题代码 q1、q2、q3 和 q4。

用这个方程创建一个新的“方程”类型的问题(我们称之为“maxVal”)。

{max(q1, q2, q3, q4)}

然后您可以使用嵌套的 IF 来显示最高的公式问题代码(为清楚起见插入了换行符):

{if(q1 == maxVal, 'q1', if(q2 == maxVal, 'q2', if(q3 == maxVal, 'q3', if(q4 == maxVal, 'q4', '' ))))}

于 2015-05-11T20:14:08.190 回答