Welcome to the LimeSurvey Community Forum

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

Pre-fill answer in hidden question with participant token value - for statistics

More
6 years 6 months ago #158531 by dotxm
Hello, I am trying to allow a user to filter the results in the analysis page based on token value.

For instance:
Show the results of all the participants that have 'Europe' in their 'Region' token

This means that the question itself should be hidden from the participant. It only exists for analysis purposes.

I tried creating an equation question with the equation field set to any of the following, but it is always empty:
{TOKEN:ATTRIBUTE_1}
{if(1==1,TOKEN:ATTRIBUTE_1,'nothing')}
'something'
1

The relevance equation did not make any difference. With or without any value, I am getting nothing in the question.

It is clear to me that I am missing something very obvious here, but right now I am well and truly stuck.

Any ideas?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158540 by tpartner
The first equation looks correct.

First leave the question visible so you can see if it is being loaded, then hide it with question class "hidden".

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: dotxm
The topic has been locked.
More
6 years 6 months ago #158557 by dotxm
Thank you, Tony!

It appears that when you try to hide a group of questions, then none of the answers is taken into account in the statistics.

The problem was that I wanted to hide the entire group, and I have set the group's relevance equation to 1==2.

Once I showed it again, and only set the questions with the class 'hidden', their data appeared in the statistics.

As for using these questions for statistics filtering, I changed the question type to free text, so that it would be possible to at least filter by entering text in the chosen boxes.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose