- Posts: 7
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Calculating the value of the third form field from two entered values
- krizis
- Topic Author
- Offline
- New Member
Less
More
3 years 7 months ago - 3 years 7 months ago #205541
by krizis
Calculating the value of the third form field from two entered values was created by krizis
Hello! Just started learning Limesurvey, what am I doing wrong (Limesurvey Version 3.22.20)
Example: I want to count downtime of employees
1 question (N1): How many times do you smoke (enter a number)
Question 2 (N2): How many times do you go to drink tea (number input)
Question 3 (N3) displays its running time: {8*60-n1*10-n2*15} - Question type: Display text or Short free text)
If you enter a formula in the question field, then everything is considered good.
What needs to be done to get this result into BD, tried to insert
in the general options -> relevance equation, it did not work
All 3 values are needed
Thank you in advance
Example: I want to count downtime of employees
1 question (N1): How many times do you smoke (enter a number)
Question 2 (N2): How many times do you go to drink tea (number input)
Question 3 (N3) displays its running time: {8*60-n1*10-n2*15} - Question type: Display text or Short free text)
If you enter a formula in the question field, then everything is considered good.
What needs to be done to get this result into BD, tried to insert
Code:
8*60-n1*10-n2*15
All 3 values are needed
Thank you in advance
Last edit: 3 years 7 months ago by krizis.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
3 years 7 months ago #205542
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Calculating the value of the third form field from two entered values
Hi,
at the moment you only display the result.
But you have to use a question of type "equation" to create a new variable that is stored.
Then instead of calculating the value again you may use this equation to display in the "text display" question.
Like
N1
N2
eqResult: {480 -10*N1 -15*N2} (if there are no missing brackets in your formula)
N3: And the result is: {eqResult}
Here you decide if a group/question/subquestion is displayedf or not.
manual.limesurvey.org/ExpressionScript_E...ation.2FBranching.29
at the moment you only display the result.
But you have to use a question of type "equation" to create a new variable that is stored.
Then instead of calculating the value again you may use this equation to display in the "text display" question.
Like
N1
N2
eqResult: {480 -10*N1 -15*N2} (if there are no missing brackets in your formula)
N3: And the result is: {eqResult}
No, of course not. The relevance equation is something quite different.in the general options -> relevance equation, it did not work
Here you decide if a group/question/subquestion is displayedf or not.
manual.limesurvey.org/ExpressionScript_E...ation.2FBranching.29
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: krizis
The topic has been locked.
- krizis
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
3 years 7 months ago #205544
by krizis
Replied by krizis on topic Calculating the value of the third form field from two entered values
Thank you very much, everything worked out.
It turns out that you just need to choose the right type of question.
Great description and example manual.limesurvey.org/Question_type_-_Equation
It turns out that you just need to choose the right type of question.
Great description and example manual.limesurvey.org/Question_type_-_Equation
The topic has been locked.