Welcome to the LimeSurvey Community Forum

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

Gobal counter

  • oguerrer
  • oguerrer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200613 by oguerrer
Gobal counter was created by oguerrer
Hi,

I am trying to setup a global counter to keep track of how many groups the user has gone through. I was able to setup an equation question QCOUNTER at the beginning set to zero.

The problem comes when I try to increment the counter by one. When I enter a group, my first question is an equation type, with {QCOUNTER=QCOUNTER+1}. The problem is that this does not return the result that I expect. For example, for the first group, instead of making QCOUNTER one, it makes it 3!

I don't understand why this is is happening.

Thanks in advance.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200622 by tpartner
Replied by tpartner on topic Gobal counter
What LimeSurvey version are you using?

Can you provide a small sample survey?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200623 by Joffm
Replied by Joffm on topic Gobal counter
Very probably you display "group by group".
So the counter is raised for each question answered.


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • oguerrer
  • oguerrer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200626 by oguerrer
Replied by oguerrer on topic Gobal counter
Thanks for your quick response, I am using version 4.2.0+200422. I think I found how to sort it out, although I don't understand why it works. Basically, when setting up the QCOUNTER to zero, the question has to be equation type. However, when increasing the count, the question should be numeric. Any idea why this is the case?
The topic has been locked.
  • oguerrer
  • oguerrer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200628 by oguerrer
Replied by oguerrer on topic Gobal counter
Thanks for your quick response, yes, this makes sense because I have 3 questions in the group.

I think I solved it: when setting up the QCOUNTER to zero, the question has to be equation type. However, when increasing the count, the question should be numeric.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200630 by tpartner
Replied by tpartner on topic Gobal counter

I think I solved it: when setting up the QCOUNTER to zero, the question has to be equation type. However, when increasing the count, the question should be numeric.

This should not be. You can set other questions from within an equation question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • oguerrer
  • oguerrer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago - 3 years 10 months ago #200631 by oguerrer
Replied by oguerrer on topic Gobal counter
That's weird. I am attaching a sample of the survey. The questions of the counter are QCOUNTER, G01Q00 and G02Q00. They way I am sending it it works fine but as soon as you change G01Q00 and G02Q00 to equation types, the problem appears.

Cheers

File Attachment:

File Name: limesurvey...4234.lss
File Size:387 KB
Last edit: 3 years 10 months ago by oguerrer.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200638 by tpartner
Replied by tpartner on topic Gobal counter
Sorry, we don't have time to go through full surveys. If you want help, attach survey exports containing only the relevant questions and groups.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200651 by Joffm
Replied by Joffm on topic Gobal counter
1. As I said before:
If you use an equation it is triggered with each answer.
But a question is not, just once.

But:
I am a bit wondering, what this counter is used for.
There are neither conditions on your groups nor other limitations.
So the respondents has to answer all of them.


2. Why do you use these default alphanumerical codes in your scales.
Then you use a relevance equation in the "confidence questions" like
((Q1.NAOK == "AO02" or Q1.NAOK == "AO03" or Q1.NAOK == "AO04" or Q1.NAOK == "AO05" or Q1.NAOK == "AO06"))
You could have said
Q1.NAOK != "AO07"

Or - as you use assessment values - you might have said
Q1.valueNAOK < 6

If you had used numerical codes "1", "2", ... you could have shortened to
Q1.NAOK < 6
You see, it is a scale. Some time you want to calculate means and do other statistical tests in your analysis.
Then you need numerical codes.

Just to consider.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • oguerrer
  • oguerrer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200652 by oguerrer
Replied by oguerrer on topic Gobal counter
The counter is unrelated to the conditionals that you point out. First I am trying to see if it counts correctly. As you say, it seems that the equation is triggered with every response, that is why it's not working as I want. However, it works fine if I use any other type of question.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose