Welcome to the LimeSurvey Community Forum

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

having trouble with an equation-type

  • thamires.costa
  • thamires.costa's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 weeks ago #225744 by thamires.costa
having trouble with an equation-type was created by thamires.costa
Good afternoon,
We're having trouble with an equation-type question that we copied from another valid survey and couldn't find the solution. I believe the problem might in the lime, so we ask for assistance directly here. To explain it properly:We have a numerical type question for age "age" and an equation type question to group these values "agegroup".
The agegroup code is showing as valid, and both questions were copied from a survey whose database came 100% correct). Although the "agegroup" code is valid, the respective column in the database is coming with the full equation instead of the arguments (or empty). Plus the quotas are not recognizing the arguments.
Both questions are set up identically as in the successful survey. What would be the error in this case and a possible solution? Could it be a mistake by limesurvey itself?

The settings:
"age" [Type:Numeric input Mandatory:Yes Relevance equation:1 Minimum value:16 Maximum characters:2 Maximum value:99] and a grouping"agegroup" [Question: agegroup=if(age.NAOK > 59, ">=60", if(age.NAOK > 44, "45-59", if(age.NAOK > 34, "35-44", if(age.NAOK > 24, "25-34", if(age.NAOK > 17, "18-24"))))) Type:Equation Mandatory:Yes Relevance equation:1 Always hide this question:1].Thanks!


Your LimeSurvey version: Versão 3.19.1+191009
 

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 weeks ago #225753 by tpartner
Replied by tpartner on topic having trouble with an equation-type
Can you attach a small sample survey (.lss file) containing only the relevant questions?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • thamires.costa
  • thamires.costa's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 weeks ago #225758 by thamires.costa
Replied by thamires.costa on topic having trouble with an equation-type
Yes, here it is. 

File Attachment:

File Name: limesurvey...1874.lsg
File Size:4 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 weeks ago - 2 years 3 weeks ago #225759 by Joffm
Replied by Joffm on topic having trouble with an equation-type
Hi,
Tony - and we all - always ask for a lss file (with only the relevant questions)
Reason:
1. lsq (q=question) and lsg (g=group) exports are language sensitive.
You can't import such an export into a survey with a different base language.
So we have to guess the base language of your export, create a survey to be able to import it.
And only the lss export contains some general settings that might be important. (e,g, the quotas)
Please, ease our live.

2. It is obvious that we cannot go through a survey with more than 100 question to find the one with the issue.
To do this, copy your survey, remove all groups and questions not related to the problem and attach this as lss export.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 3 weeks ago by Joffm.

Please Log in to join the conversation.

  • thamires.costa
  • thamires.costa's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 weeks ago #225762 by thamires.costa
Replied by thamires.costa on topic having trouble with an equation-type
It's OK. Here's Iss.
Sorry for the confusion. 

File Attachment:

File Name: limesurvey...3786.lss
File Size:16 KB

Please Log in to join the conversation.

  • thamires.costa
  • thamires.costa's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 weeks ago #225763 by thamires.costa
Replied by thamires.costa on topic having trouble with an equation-type
Sorry for the mistake again. Here is the file as you asked. 

File Attachment:

File Name: limesurvey...6354.lss
File Size:72 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 weeks ago #225764 by Joffm
Replied by Joffm on topic having trouble with an equation-type
Sorry, I do not see any issue
 

except the missing classification of the 16 and 17 years old participants
and there were no quotas.

But I am wondering why you use an assignment in the equation.
It is sufficient to use {if(age.NAOK>59,"xxx",if(age.NAOK>47,...
This way the value is stored in a variable with the name of the equation (agegroup)
Your syntax is used when you want to assign something to a different question, e.g. presetting it.

Is it really necessary to have a text as classification.
I think you will use it later in your analysis, e.g. to calculate an ANOVA or other statistical tests.
Wouldn't it be better to use numerical codes.

Or coming back to the assignment, create a (hidden) question of type "list(radio)" called "agegroup"
with the answer options
1 : <18
2: 18-24
3: 25-34
...

and in the equation (called "EQagegroup") you assign the value:
{agegroup=if(age.NAOK > 59, 6, if(age.NAOK > 44, 5, if(age.NAOK > 34, 4, if(age.NAOK > 24, 3, if(age.NAOK > 17, 2,1)))))}

Joffm


 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 weeks ago #225765 by holch
Replied by holch on topic having trouble with an equation-type
I had a look at the first file you sent and there are a couple of things wrong. You allow age 16 and above, but you do not have any age category defined for age 16 and 17. So if you put 16 or 17, nothing will show up.

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

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 weeks ago #225767 by holch
Replied by holch on topic having trouble with an equation-type
off-topic:

Your LimeSurvey version: Versão 3.19.1+191009


In times of data protection laws like GDPR and in your case LGPD you really shouldn't run such an old version of a software that potentially collects personal data. Your installation hasn't been updated since October 2019 and thus has not received any security updates or bug fixes since then.

I highly recommend to update your installation to at least the lastest version of the LS 3.x branch, which today is 3.28.1 (from 29/02/2022).

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: gabriela.garcia

Please Log in to join the conversation.

More
2 years 3 weeks ago - 2 years 3 weeks ago #225775 by gabriela.garcia
Replied by gabriela.garcia on topic having trouble with an equation-type
Thank you very much, Joffm.

In these new 'agegroup' and 'EQagegroup', should I keep the relevance equation as 1 or should I asign the code to it?

Also, only in the test my peer sent you the merging is working well. Although she copied the two questions from the original survey, in the original, the same previous code comes like this:

 
Last edit: 2 years 3 weeks ago by gabriela.garcia.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 weeks ago #225776 by holch
Replied by holch on topic having trouble with an equation-type
Do not copy images into the editor, it will just give weird code here in the forum.

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: gabriela.garcia

Please Log in to join the conversation.

More
2 years 3 weeks ago #225777 by gabriela.garcia
Replied by gabriela.garcia on topic having trouble with an equation-type
I just fixed it

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose