Welcome to the LimeSurvey Community Forum

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

Referencing an answer using SGQA

More
2 weeks 3 hours ago - 2 weeks 2 hours ago #268947 by Howdy
Referencing an answer using SGQA was created by Howdy
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.3.4
Own server or LimeSurvey hosting:
Survey theme/template: Fruity
==================
I'm attempting to present the answer from one question to a subsequent question. This should be super easy but reading through the manual and searching the forum didn't give me a solution that worked (probably user error!).

Q1 is type: Input on demand where the respondent can enter multiple text entries. These subquestions are given the Code of the format: Q1B1, Q1B2, Q1B3, etc.
Q2 is type: Ranking advance and asks the respondent to rank order their entries from Q1. For the answer options, I'm using SGGQA format.  In this case, my surveyID = 822541, groupID = 91, questionID = 1503, answerID = Q1_Q1B1. I got those IDs from the Survey Logic View table. So, for the first answer option I use in Q2: {822541X91X1503XQ1_Q1B1}
But when I preview the survey, I just see a list of items in the format: {822541X91X1503XQ1_Q1B1} as opposed to what answers they had entered in Q1.

Please let me know what I'm doing incorrectly. Thank you!
Last edit: 2 weeks 2 hours ago by Howdy. Reason: typo

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 2 hours ago - 2 weeks 2 hours ago #268948 by Joffm
Replied by Joffm on topic Referencing an answer using SGQA
Hi,

For the answer options, I'm using SGGQA format

Why do you do this?
You should use ExpressionScript?
 

And the array filter of Q0b on Q0a
 

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 weeks 2 hours ago by Joffm.

Please Log in to join the conversation.

More
2 weeks 52 minutes ago #268950 by Howdy
Replied by Howdy on topic Referencing an answer using SGQA
Thank you for the quick response. I tried using ExpressionScript as you demonstrated, but it didn't work for me. It's likely I'm using incorrect syntax. If my first question's code is Q1 and the subquestion codes are Q1B1, Q1B2, Q1B3, etc. then in my second question (code Q2) where I ask the respondent to rank their items from Q1, what should the Answer options syntax should be?

Here's what I tried for Q2:
Code     Answer options
Q2R1    {Q1_Q1B1}
Q2R2    {Q1_Q1B2}

as well as:
Code     Answer options
Q2R1    {Q1B1}
Q2R2    {Q1B2}

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 41 minutes ago #268951 by Joffm
Replied by Joffm on topic Referencing an answer using SGQA
Always the best:
Send the lss export of these relevant questions.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
2 weeks 26 minutes ago #268952 by Howdy
Replied by Howdy on topic Referencing an answer using SGQA
Unfortunately, IT restrictions prevent me from uploading lss files

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 week 6 days ago - 1 week 6 days ago #268954 by Joffm
Replied by Joffm on topic Referencing an answer using SGQA
Hi,
well, your first attempt is correct,
{Q1_Q1B1}
meaning: subquestion code "Q1B1" in question "Q1"
but only as long you don't want to use "array filter"
Why?
Because in Q2 the answer options are different.
Here you'd have a subquestion code like "Q2R1".

If you read the manual about "array filter"
[url] www.limesurvey.org/manual/Question_type_...ilter_(array_filter) [/url]
you'd have found
The subquestion codes used in the first question must coincide with the subquestion codes from the second one. Otherwise, the array filter function will not filter the answers to the first question.

In your case they do not.
Why don't you use just numeric codes as I showed in the screenshot?
I will never understand why somebody usues such strange subquestion codes without needs and furthermore doubles it (Q1_Q1B1)

Joffm

And you always can create a sample here
demo.limesurvey.org/admin/

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 week 6 days ago by Joffm.
The following user(s) said Thank You: Howdy

Please Log in to join the conversation.

More
1 week 5 days ago #268969 by Howdy
Replied by Howdy on topic Referencing an answer using SGQA
Thank you for your continued assistance. I realize the frustration helping new users.
I cleaned up the format of my codes - thanks for that tip.

I was still not getting it to work. So, I tried different things and found the issues as there's some inconsistencies in LimeSurvey (apologies if these are already known issues).
1) It wouldn't work for Ranking Advanced. But it works for Ranking
2) If referencing their response from a subquestion of multiple choice (Type: M), I needed to append: .question
For example: {Q4_1.question} works
(Q4_1} does not

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 week 5 days ago - 1 week 5 days ago #268970 by Joffm
Replied by Joffm on topic Referencing an answer using SGQA
Hi,
exactly, you have to explain very detailed.
If you say "ranking" it's ranking, nothing else.

And your second poont:
This is explained in the manual.

You have to distinguish.
If you want to display a label of a "coded" question you have to use ".shown", if it is an open question (text, numbers), the QCODE is sufficient.

And you asked about an "input on demand', open text question.

If you look at the answer table you will see the difference.

Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 week 5 days ago by Joffm.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose