Welcome to the LimeSurvey Community Forum

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

Array unique(self) combined with array filter

  • AcuDan
  • AcuDan's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 23 hours ago - 2 years 23 hours ago #233665 by AcuDan
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 3.17.16+190906
Own server or LimeSurvey hosting: Own
Survey theme/template: fruity
==================
Is it possible to use this as question validation in combination with an array filter? I've tested using unique(self) without and it works, but once I add an array filter it appears to always fail

I've attached a copy of the survey where this is not working for me

 

File Attachment:

File Name: unique_self_test.lss
File Size:26 KB
Last edit: 2 years 23 hours ago by AcuDan.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 22 hours ago #233670 by tpartner
Replied by tpartner on topic Array unique(self) combined with array filter
Try unique(self.NAOK)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 22 hours ago - 2 years 22 hours ago #233671 by Joffm
It is quite obvious that it doesn't work this way.
If you only select two or three items in Q1 you only rate these in Q2. The rest of subquestions has the same value -> not unique.

Please, read the manual about ".NAOK"
[url] www.limesurvey.org/manual/ExpressionScri...ion/en#Usage_of_NAOK [/url]

With the correct validation equation "unique(self.NAOK)" and a validation tip it is fine.
   



Last remark: Do not use the Condition builder, use Relevance equations instead.
Read here about the Pros and Cons of both.
[url] www.limesurvey.org/manual/ExpressionScri...ons_and_Relevance.3F [/url]

By the way: Your relevance equation of Q2 is not necessary. This is done by the array filter.


A last word. Is it really necessary to force your respondents to click twice for each answer (drop-down-Layout)?
Why not the usual array layout?

Joffm
 

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

Please Log in to join the conversation.

  • AcuDan
  • AcuDan's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 22 hours ago #233672 by AcuDan
Thanks!

Please Log in to join the conversation.

  • AcuDan
  • AcuDan's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 21 hours ago #233679 by AcuDan

A last word. Is it really necessary to force your respondents to click twice for each answer (drop-down-Layout)?
Why not the usual array layout?

Joffm

Apologies - this is just a dumbed down version of the real question as an example. I'm using dropdowns as the answer options are shown/hidden using javascript based on how many options were selected at Q1 and which answer options have already been used at Q2. I think it looks cleaner to have this interaction hidden under the dropdown.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 19 hours ago #233699 by Joffm
Agreed.

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

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose