Expression Manager summary with placeholders: how to only show specific answers

More
4 years 5 months ago #116441 by eleren
Case: array question with 5-step label from "don't agree at all" to "completely agree" and, say, 6 subquestions.
I found out how to display the answers in a "text display" question type.
But how can I display only the "don't agree at all" answers?
And how can I filter out the "non applicable" answers?

manual.limesurvey.org/Expression_Manager...e_using_placeholders

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

LimeSurvey Partners
More
4 years 5 months ago #116443 by holch
Well, you will need to write an expression that first checks the value of the answer (e.g. something like "if answer1 == 1 then write "blablabla".

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

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

More
4 years 5 months ago #116445 by eleren
OK, I understand, but I can't figure out the right syntax:

I tried
{if(Q1_sq001.shown=='don't agree at all')}{Q1_sq001.question}: {Q1_sq001.shown}
but his gives me a syntax error.

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

More
4 years 5 months ago #116448 by holch
Of course, because it is not a valid EM syntax. Have a look at the examples in the manual and I think you'll figure it out.

You need to understand how the "if" loop in EM is built. Because you say "if something happens." Full stop. You closed the expression. You need to give it something to work with within {}.

Have a look at the examples here using if:

manual.limesurvey.org/Expression_Manager

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

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

More
5 months 2 weeks ago #179089 by Mazi

eleren wrote: OK, I understand, but I can't figure out the right syntax:

I tried
{if(Q1_sq001.shown=='don't agree at all')}{Q1_sq001.question}: {Q1_sq001.shown}
but his gives me a syntax error.


You are Also using single quote around the to be checked text but the to be checked text contains a single quote as well. So that won't work because the quote within the text closes the expression.
In addition, the whole expression is a little wrong.

It should be like this:
{if(Q1_sq001.shown=="don't agree at all", Q1_sq001.question, Q1_sq001.shown)}

Some more notes:
1. Subquestion codes are usually like "SQ001" and not "sq001".

2. Your expression shows the question text if the answer is "don't agree..." and if not it shows the answer texts. Not sure if this is intended. Possible solution to show question text + answer text if true and nothing if false:
{if(Q1_sq001.shown=="don't agree at all", join(Q1_sq001.question, ": ", Q1_sq001.shown),"")}

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com

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

More
5 months 1 week ago #179104 by DenisChenu
Whuy using .shown ? You choice "Don't agree at all" have a code, use the code ( {if(Q1_sq001.NAOK=="NOAGR", join(Q1_sq001.question, ": ", Q1_sq001.shown),"")}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

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!