Welcome to the LimeSurvey Community Forum

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

Get value of array question answers?

  • rcha88AA
  • rcha88AA's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 3 weeks ago - 6 years 3 weeks ago #165733 by rcha88AA
Get value of array question answers? was created by rcha88AA
Hi, first of all thank you for LimeSurvey, it is fantastic.

My problem:
I have an array question (D01), with subquestions and text answers, and I want to use the answers with the expression manager.

My answers (the array headings) from left to right are 'AA', 'BB', 'CC', 'DD'.
It looks something like this:
AABBCCDD
Ques 1X
Ques 2X

I want to get the value of the answers.
For subquestion 1, I don't want to get 'CC', I want to get 2. (0 being AA, 1 being BB, 2 being C... etc)
And for subquestion 2, I want to get 1.

Is this possible, without using the assessment functionality?
Basically, I just want to get the x-value/position of each subquestion's answer.

Using this does not work for me, I always get a value of 0.
{sum(D01_SQ001.value, D01_SQ002.value)}
I think this .value requires the assesment values to be set up.

Thank you.
Last edit: 6 years 3 weeks ago by rcha88AA.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 3 weeks ago #165738 by Joffm
Replied by Joffm on topic Get value of array question answers?
Hi,
well, you show us the answer labels "AA", "BB", ...
But what did you set as answer option codes?
Here you set 0, 1, 2, 3,...





Or do I misunderstand?

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: rcha88AA
The topic has been locked.
  • rcha88AA
  • rcha88AA's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 3 weeks ago #165854 by rcha88AA
Replied by rcha88AA on topic Get value of array question answers?
Joffm - thank you!

Yes, now if I set the answer codes like 0, 1, 2, 3 (before it was the default A1...)
and when I use this, I get the result I am looking for!
{sum(D01_SQ001, D01_SQ002)}

Thanks again.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose