Welcome to the LimeSurvey Community Forum

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

Variable always +1

  • Marv12
  • Marv12's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158451 by Marv12
Variable always +1 was created by Marv12
Hi,

is it possible to define a variable in the beginning with the value "0" and then after each question add "1" to this variable?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158463 by tpartner
Replied by tpartner on topic Variable always +1
You could put an equation type question in the first group with a value of 0 and then increment it with equation questions in every subsequent group, using the assignment operator.

manual.limesurvey.org/Expression_Manager..._Assignment_Operator

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158493 by DenisChenu
Replied by DenisChenu on topic Variable always +1
I don't like to use a Equation question type for the counter, prefer an numeric questioin type with default value 0 :)

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158509 by tpartner
Replied by tpartner on topic Variable always +1
Why?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158511 by DenisChenu
Replied by DenisChenu on topic Variable always +1
Because, for example : if you have index activated : Equation can be resetted when submit.
In fact Equation is resetted each time "step" is done (move previous for example).

With a default value : it's set only if it's null :) or not set.

I think reload survey can reset the value too (to be tested).

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.

Lime-years ahead

Online-surveys for every purse and purpose