Welcome to the LimeSurvey Community Forum

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

summarise two fields in another third field

  • nibos
  • nibos's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 weeks ago #150896 by nibos
Hi there,
On a survey I have three numeric fields of the same type (field A,B,C). I want the default value of the field C to be the total of A+B (C=A+B).

What should I do?

Thank you.
The topic has been locked.
More
7 years 4 weeks ago #150901 by fvanderstarre
Replied by fvanderstarre on topic summarise two fields in another third field
Hi,

You can enter {A.NAOK + B.NAOK} as the default value for C - but C has to be in a separate (later) question group from A and B.

Cheers, Frank
The topic has been locked.
  • nibos
  • nibos's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 weeks ago #150907 by nibos
Thank you for your response.
I tried it but it doesn't seem to work. I put the question C in another group after the other two questions A,B (on the same group) and I placed the code on the last tab of field C "Edit default answer values" but no result (0 zero is only displayed).
The topic has been locked.
More
7 years 4 weeks ago #150909 by fvanderstarre
Replied by fvanderstarre on topic summarise two fields in another third field
Well, I tried myself and it worked fine (using version 2.64.0+170307)!
Please find attached my sample survey using this "feature", maybe you can import it and have a look (if you are using this version - if not, I can also set up a sample for 2.6.4lts build 170202 if you wish).
The topic has been locked.
  • nibos
  • nibos's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 weeks ago #151057 by nibos
Thank you. My version is 2.06+ Build 151215
Can you send me another sample for that version instead?
The topic has been locked.
  • nibos
  • nibos's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 weeks ago #151058 by nibos
I tried worked but only if these fields C and A,B are in different page-view. Can this worked even they are on the same page?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 weeks ago #151059 by DenisChenu
Replied by DenisChenu on topic summarise two fields in another third field
If A or B are "Equation question type" then yes : only done in PHP, else it work on same page.

Remind : + is strange sometimes, better to use sum or join function to be sure.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • nibos
  • nibos's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 weeks ago #151065 by nibos
Thank you. What do you mean by "Equation question type"?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 weeks ago #151068 by DenisChenu
Replied by DenisChenu on topic summarise two fields in another third field
We have a manual ...... best is to read the manual
manual.limesurvey.org/Question_type_-_Equation

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • nibos
  • nibos's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 weeks ago #151072 by nibos
thank you
The topic has been locked.
More
7 years 3 weeks ago #151126 by fvanderstarre
Replied by fvanderstarre on topic summarise two fields in another third field
I set up a sample survey in 2.6.4lts, I think you can import that in 2.06 without problems.
This should work!
The following user(s) said Thank You: nibos
The topic has been locked.
  • nibos
  • nibos's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 3 weeks ago #151127 by nibos
Thank you, it worked fine.

Is there any way that this will also work if all these fields e.g. A,B,C will be in the same group and the survey is being displayed in one page instead of in separate?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose