Welcome, Guest
Username: Password: Remember me

TOPIC: Calculated value from numeric

Calculated value from numeric 2 years 11 months ago #68993

  • ulysse68
  • ulysse68's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 37
  • Thank you received: 2
  • Karma: 0
Hi all!

Is it possible to display a value calculated from a previous entry? For example, I ask the birth year, and on the next screen, I want to display the age of the person, to be sure there haven't been any mistake. I didn't find that in the replacing fields -- I can display the entry, but not compute data.

Thanks for your hints!
U.
The administrator has disabled public write access.

Re: Calculated value from numeric 2 years 11 months ago #69001

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
Such a feature doesn't exist yet but at the next Limesurvey version there will be a complex Expression Manager that should be able to handle such cases, see docs.limesurvey.org/Expression+Manager+HowTos.

As a temporary workaround you can place both questions on the same page and use some Javascript to calculate the age.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
The following user(s) said Thank You: ulysse68

Re: Calculated value from numeric 2 years 11 months ago #69003

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4270
  • Thank you received: 803
  • Karma: 368
As a temporary workaround you can place both questions on the same page and use some Javascript to calculate the age.

Or leave the questions on separate pages. In page 2, use {INSERTANS} to retrieve the entered date value and then do the calculation with JavaScript and display the age.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: ulysse68

Re: Calculated value from numeric 2 years 11 months ago #69004

  • ulysse68
  • ulysse68's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 37
  • Thank you received: 2
  • Karma: 0
Thanks to both of you!
U.
The administrator has disabled public write access.

Re: Calculated value from numeric 2 years 11 months ago #69018

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
ulysse68 wrote:
Thanks to both of you!
U.
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Calculated value from numeric 2 years 11 months ago #69082

  • macmariner
  • macmariner's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Can anyone supply any example javascript code.

Sorry, I know nothing about writing javascript code.

Thanks
Last Edit: 2 years 11 months ago by macmariner. Reason: spelling, doh!!
The administrator has disabled public write access.

Re: Calculated value from numeric 2 years 11 months ago #69103

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
If you create a simple demo survey and link it here we can give some advice.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.125 seconds
Donation Image