Welcome to the LimeSurvey Community Forum

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

I'm not using the correct syntax.

  • moisespaivaspi
  • moisespaivaspi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 2 months ago #163142 by moisespaivaspi
I'm not using the correct syntax. was created by moisespaivaspi
Good afternoon.

I am trying to implement a final report in my survey as exemplified in one of the attached images. The problem is that I am not being able to correctly use the syntax to appear the desired results such as:

"Your Institution of affiliation is a {question 1 code} and your personal Role / Position therein is {question 2 code}.

Can someone help me with the syntax needed for my examples?

Thank you very much.
Best regards.
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago - 6 years 2 months ago #163152 by holch
Replied by holch on topic I'm not using the correct syntax.
Well, without knowing your questions and how they are structured, it is even harder for us to get the syntax correct. We can only guess. Each question type requires a different syntax, because the structure is different.

The screenshot with the questions has little to nothing to do with the screenshot of the report. The report has many different questions and types, as far as I could see, while your screenshot with the questions just shows simple list type questions.

For simple questions like lists with radiobuttons you can simply use the question code, like this: {questioncode}

To get answers for multiple answer questions, matrix questions, etc. which have subquestions, you can get the response for the subquestion with something like this: {questioncode_subquestioncode}.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 6 years 2 months ago by holch.
The topic has been locked.
  • moisespaivaspi
  • moisespaivaspi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 2 months ago #163153 by moisespaivaspi
Replied by moisespaivaspi on topic I'm not using the correct syntax.
I understand.
I have attached a print of the questions that I have, is it that with this attachment, can you better understand what I intend?

Best regards.
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago #163155 by holch
Replied by holch on topic I'm not using the correct syntax.
No, that doesn't help much. Because the screen print doesn't show your question and subquestion codes, etc. But with my hint and a look at the manual pages regarding the expression manager, you should be easily able to create your report.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: moisespaivaspi
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago #163170 by tpartner
Replied by tpartner on topic I'm not using the correct syntax.
To return the label value of a single-choice question, use Qcode.shown - manual.limesurvey.org/Expression_Manager#Access_to_Variables

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: moisespaivaspi
The topic has been locked.
  • moisespaivaspi
  • moisespaivaspi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 2 months ago #163178 by moisespaivaspi
Replied by moisespaivaspi on topic I'm not using the correct syntax.
Good Morning.

I was reading the manual and tried to put an example to my final report. However you are not showing me the value intended. The result presents the code of the option and not the text of the option that is what I intend to present.

Best regards.
The topic has been locked.
More
6 years 2 months ago #163180 by jelo
Replied by jelo on topic I'm not using the correct syntax.
In your screenshots I don't see anything tpartner recommended to you.

Did you already try {Q1X2.shown}?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: moisespaivaspi
The topic has been locked.
  • moisespaivaspi
  • moisespaivaspi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 2 months ago #163181 by moisespaivaspi
Replied by moisespaivaspi on topic I'm not using the correct syntax.
Good Morning.
With the "shown" it working :cheer: .

However there is a value that it does not present.
For example:
Is there a way to fetch and display the text of the "other" option?

Because if I select the "other" option and type text in that option, the final report just shows me a "- oth -" generic text.

Thank you in advance for your patience and help.
Best regards.
The topic has been locked.
More
6 years 2 months ago #163193 by jelo
Replied by jelo on topic I'm not using the correct syntax.
The other field is accessible via
{Q1X2_other.value}

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: moisespaivaspi
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago - 6 years 2 months ago #163194 by tpartner
Replied by tpartner on topic I'm not using the correct syntax.
For a list-radio type question, this will show the selected label value unless the "Other" text field is populated, in which case that text is shown.

Code:
{if(!is_empty(Q1X2_other), Q1X2_other, Q1X2.shown)}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 2 months ago by tpartner.
The following user(s) said Thank You: moisespaivaspi
The topic has been locked.
  • moisespaivaspi
  • moisespaivaspi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 2 months ago #163198 by moisespaivaspi
Replied by moisespaivaspi on topic I'm not using the correct syntax.
Many thanks :D

I'ts works.

Best regards.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose