I'm not using the correct syntax.

More
10 months 2 weeks ago #163142 by moisespaivaspi
moisespaivaspi created the topic: I'm not using the correct syntax.
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.
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago - 10 months 2 weeks ago #163152 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last Edit: 10 months 2 weeks ago by holch.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #163153 by moisespaivaspi
moisespaivaspi replied the 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.
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #163155 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: moisespaivaspi

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #163170 by tpartner
tpartner replied the 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

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #163178 by moisespaivaspi
moisespaivaspi replied the 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.
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #163180 by jelo
jelo replied the 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}?

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
The following user(s) said Thank You: moisespaivaspi

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #163181 by moisespaivaspi
moisespaivaspi replied the 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.
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #163193 by jelo
jelo replied the topic: I'm not using the correct syntax.
The other field is accessible via
{Q1X2_other.value}

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
The following user(s) said Thank You: moisespaivaspi

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago - 10 months 1 week ago #163194 by tpartner
tpartner replied the 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.

{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: 10 months 1 week ago by tpartner.
The following user(s) said Thank You: moisespaivaspi

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #163198 by moisespaivaspi
moisespaivaspi replied the topic: I'm not using the correct syntax.
Many thanks :D

I'ts works.

Best regards.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!