Check out the LimeSurvey source code on GitHub!

LS 2.00+: Referencing multiple choice subquestion with SGQA notation

More
4 years 3 months ago #87541 by spacejanitor
I'm trying to do a count of the amount of checkboxes that were checked in a previous multiple choice question.

Here's my syntax: {count(555824X11X93_A,555824X11X93_B,555824X11X93_C)}

But I'm getting an undefined variable error.

Any suggestions? I cannot use qCode notation because it's in a different group.

Thank you

I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!

Please Log in to join the conversation.

More
4 years 3 months ago #87544 by floccs
use count(that.Q_CODE.NAOK) to count all the checked answer in question Q_CODE

use count(that.Q_CODE.sq_A.NAOK,that.Q_CODE.sq_B.NAOK,that.Q_CODE.sq_C.NAOK) to count the checked answers between subquestions A, B, C of question Q_CODE

Please Log in to join the conversation.

More
4 years 3 months ago #87545 by spacejanitor

floccs wrote: use count(that.Q_CODE.NAOK) to count all the checked answer in question Q_CODE

use count(that.Q_CODE.sq_A.NAOK,that.Q_CODE.sq_B.NAOK,that.Q_CODE.sq_C.NAOK) to count the checked answers between subquestions A, B, C of question Q_CODE


The problem is that qCode can't be used since the checked answers I'm trying to count are part of a multiple choice question in another Group, and hence cannot be referenced by qCode (as far as I was able to figure out).

I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!

Please Log in to join the conversation.

More
4 years 3 months ago #87546 by TMSWhite
Qcode can be used anywhere. The EM engine does all variable processing- SGQA is now just an alias for qcode.

Please Log in to join the conversation.

More
4 years 3 months ago - 4 years 3 months ago #87547 by spacejanitor

TMSWhite wrote: Qcode can be used anywhere. The EM engine does all variable processing- SGQA is now just an alias for qcode.


So then how does one reference either of GROUP1>>Q1 or GROUP2>>Q1 ?

Both technically have the same qCode, don't they?

I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
Last Edit: 4 years 3 months ago by spacejanitor.

Please Log in to join the conversation.

More
4 years 3 months ago #87548 by TMSWhite
Qcodes must be globally unique for the survey. You cannot use Q1 as the name of two different questions.

Please Log in to join the conversation.

More
4 years 3 months ago #87550 by spacejanitor

TMSWhite wrote: Qcodes must be globally unique for the survey. You cannot use Q1 as the name of two different questions.


Sure you can. The qCodes don't appear to be declared globally.

You can have a Q1 in Group1 and a Q1 in Group2.

In order to reference qCodes outside of their group, they would need to be declared globally and be unique to the whole survey, which currently they appear not to be. Either that, or there needs to be a prefix identifier for the group first, before the qCode, like {group}.{qCode}

I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!

Please Log in to join the conversation.

More
4 years 3 months ago #87552 by spacejanitor

TMSWhite wrote: Qcodes must be globally unique for the survey. You cannot use Q1 as the name of two different questions.


TMSWhite, if you have some time to troubleshoot and debug with me this week, my week is wide open so maybe we can look at some of these issues together.

I'm not much of a developer but I will certainly help you out in any way I am capable :)

I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!

Please Log in to join the conversation.

More
4 years 3 months ago #87553 by TMSWhite
If you use global qcodes you will be fine. I added in backwards compatible support for re-used qcodes, but i am strongly recommending that support for reused qcodes be phased out. If you look at the logic file you will see that reused qcodes are marked as warnings.

Please Log in to join the conversation.

More
4 years 3 months ago #87554 by spacejanitor

TMSWhite wrote: If you use global qcodes you will be fine. I added in backwards compatible support for re-used qcodes, but i am strongly recommending that support for reused qcodes be phased out. If you look at the logic file you will see that reused qcodes are marked as warnings.


Thanks for the clarification, TMSWhite.

I think I was mistaken because sometimes when question modifications are saved, the question "GUI" (the interface you see immediately after editing a question) shows the variable highlighted in red and "Undefined variable" displayed, even when the QA file may be valid.

It seems to be randomly that this happens, although generally immediately after saving a change. It might be that there is some lag in my database to pull the changes.

I'll run some more tests shortly and let you know of anything else :)

I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!

Please Log in to join the conversation.

More
4 years 3 months ago #87570 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form