Welcome to the LimeSurvey Community Forum

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

cascading array filters

More
4 years 8 months ago #186564 by comep
cascading array filters was created by comep
I have 3 questions

question 1 - TIPE, list - with subquestions a1,a2,a3,a4,a5
Question 2 - DSESEC, multiple answers - with sq a1..a7

Question 3 - Test. Q3 is used with casscading array filters in combination with q2. Works perfectly only in combination with question 2. When I want that question 3 to be active only if TIPE < a5, it ignores me.

I have in relevance eq the following:
{ (TipE.NAOK <= "A4") &&
((dsesec_A1_naOK == "Y") or
(dsesec_A2_naOK == "Y") or
(dsesec_A3_naOK == "Y") or
(dsesec_A4_naOK == "Y") or
(dsesec_A5_naOK == "Y") or
(dsesec_A6_naOK == "Y") or
(dsesec_A7_naOK == "Y") )}

Also i have in array vector: tipe;dsesec

Still no luck,

Can you please help me?

LS Version 2.72.5+171121
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186568 by tpartner
Replied by tpartner on topic cascading array filters
You cannot use a less-than operator on a string. Less than "A4" doesn't make any sense.

You will need to use:

Code:
TIPE.NAOK == "A1" OR TIPE.NAOK == "A2" OR TIPE.NAOK == "A3" OR TIPE.NAOK == "A4"

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: cdorin
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186574 by Joffm
Replied by Joffm on topic cascading array filters
And why do you use alphanumeric codes if you want to compare?
Use numeric codes and everythings is fine.

Then you say "TIPE<5"

Joffm

PS.
If you want to compare alphanumeric use quotes.
Then, "A4" is less then "A5", but "A14" is less than both. (the second character "1" is less than "4")

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
4 years 8 months ago #186576 by comep
Replied by comep on topic cascading array filters


I used conditions creator for the TIPe filter for others questions. They work perfectly.

I still can't manage to have both conditions to work.

Thank you anyway
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186581 by Joffm
Replied by Joffm on topic cascading array filters
Did you use a second scenario?

BTW: Use Expression Manager instead of condition manager.

Joffm

In such cases it's always recommended to send a small sample (*,lss) with the relevant questions.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186595 by Joffm
Replied by Joffm on topic cascading array filters
Hi,
I hope these are only typos.

{ (TipE.NAOK <= "A4") &&
((dsesec_A1_naOK == "Y") or
(dsesec_A2_naOK == "Y") or
(dsesec_A3_naOK == "Y") or
(dsesec_A4_naOK == "Y") or
(dsesec_A5_naOK == "Y") or
(dsesec_A6_naOK == "Y") or
(dsesec_A7_naOK == "Y") )}

In the relevance equation you do not use curly brackets.

Also i have in array vector: tipe;dsesec

Do you mean "array filter"?

1. If you have ALL subquestions of dsesec in your OR-condition, it is useless. There should be always one subquestion selected, so this part is always true.

2. A single punch question like "tipe" in array filter. ?????

All you need is the relevance equation in Q3: tipe != "A5"
- If you like to display "group by group" !is_empty(tipe) AND tipe != "A5" prevents an empty array Q3 to be displayed -
and an array filter in Q3: dsesec.

That's all.








Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
4 years 8 months ago #186597 by comep
Replied by comep on topic cascading array filters
Thank you, it worked. Have a nice day!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186601 by DenisChenu
Replied by DenisChenu on topic cascading array filters

tpartner wrote: You cannot use a less-than operator on a string. Less than "A4" doesn't make any sense.

No,

I'm not OK with this : alpha compare can always be done before 3.0 and it work. In fact it work in pure PHP and pure JS with ASCII caracter
"A" < "B"
"A1" < "A2"
etc …

The only comparaison that was unsure is "1" < "A" …

See github.com/LimeSurvey/LimeSurvey/commit/...9b8a12bc55cd33b46a1e

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose