Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Miscellaneous questions about EM

Miscellaneous questions about EM 3 years 6 months ago #95864

  • rejeanp
  • rejeanp's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hello to all,
EM is great... but if find it very difficult to do simple things. If someone could answer the following question, I would be able to progress in my learning of EM. Loking through the manual is very painful for me since I do not master the specific language of LimeSurvey. Thank you in advance.

My surveys are bilingual (english and french). When I create a variable (ex. sum(qa,qb,qc)) with the equation question type, I discovered that I have to copy and paste the same formula in both english and french section. Why is it so?

What is the proper way to create a variable (ex. sum(qa,qb,qc)) that will sum values from questions collected in a previous group?

In a typical survey, I create a group for questions and the a group for results. In the results group I create variables (equation, hidden) to save in the database. Then I create a summary (report) with text and get on variables created earlier. What is the proper way to refer to these variables?

Here is an example that does not seem to work. Showing depression_level value works but not the depression_text

depression_level = sum(question_3.NAOK, question_5.NAOK, question_10.NAOK, question_13.NAOK, question_16.NAOK, question_17.NAOK, question_21.NAOK, question_24.NAOK, question_26.NAOK, question_31.NAOK, question_34.NAOK, question_37.NAOK, question_38.NAOK, question_42.NAOK)

depression_text = if(depression_level < 10, "Normal", if(depression_level < 14, "Mild", if(depression_level < 21, "Moderate", if(depression_level < 28, "Severe", "Extremely Severe"))))
The administrator has disabled public write access.

Miscellaneous questions about EM 3 years 6 months ago #95865

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1897
  • Thank you received: 469
  • Karma: 118
Hello,

If not already made you may have a look at the "/docs" folder included in all LS original package; It contains an unvaluable set of Demo surveys showing the most useful EM features;

BTW for your "depression_level" question, the correct syntax will be very closed to:
{if(depression_level < 10,'Normal', if(depression_level < 14, 'Mild', if(depression_level < 21, 'Moderate', if(depression_level < 28, 'Severe', 'Extremely Severe'))}
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 3 years 6 months ago by Ben_V.
The administrator has disabled public write access.

Miscellaneous questions about EM 3 years 6 months ago #95867

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1897
  • Thank you received: 469
  • Karma: 118
EDIT: Missing ")"
{if(depression_level < 10,'Normal', if(depression_level < 14, 'Mild', if(depression_level < 21, 'Moderate', if(depression_level < 28, 'Severe', 'Extremely Severe'))))}
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.

Miscellaneous questions about EM 3 years 6 months ago #95868

  • rejeanp
  • rejeanp's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Thanks,
I did not know that " and ' were not equivalent.
The administrator has disabled public write access.

Miscellaneous questions about EM 3 years 6 months ago #95875

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1897
  • Thank you received: 469
  • Karma: 118
I did not know that " and ' were not equivalent.

No, it's the same and I suppose both could be used in this kind of EM expression; I thought your issue was related to the lack of curly braces wrapping the expression...

Is it working now? if not check carefully question ID codes and "Survey logic file" icon:
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.
Time to create page: 0.212 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form