Miscellaneous questions about EM

More
4 years 6 months ago #95864 by rejeanp
rejeanp created the topic: Miscellaneous questions about EM
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"))))

Please Log in to join the conversation.

More
4 years 6 months ago - 4 years 6 months ago #95865 by Ben_V
Ben_V replied the topic: Miscellaneous questions about EM
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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 4 years 6 months ago by Ben_V.

Please Log in to join the conversation.

More
4 years 6 months ago #95867 by Ben_V
Ben_V replied the topic: Miscellaneous questions about EM
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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

More
4 years 6 months ago #95868 by rejeanp
rejeanp replied the topic: Miscellaneous questions about EM
Thanks,
I did not know that " and ' were not equivalent.

Please Log in to join the conversation.

More
4 years 6 months ago #95875 by Ben_V
Ben_V replied the topic: Miscellaneous questions about EM

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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Attachments:

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!