- Posts: 9
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
cascading array filters
- comep
- Topic Author
- Offline
- New Member
Less
More
4 years 9 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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
4 years 9 months ago #186568
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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:
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3964
4 years 9 months ago #186574
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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")
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.
- comep
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
4 years 9 months ago #186576
by comep
Replied by comep on topic cascading array filters
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3964
4 years 9 months ago #186581
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3964
4 years 9 months ago #186595
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic cascading array filters
Hi,
I hope these are only typos.
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
I hope these are only typos.
In the relevance equation you do not use curly brackets.{ (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") )}
Do you mean "array filter"?Also i have in array vector: tipe;dsesec
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
Attachments:
The topic has been locked.
- comep
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
4 years 9 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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 9 months ago #186601
by DenisChenu
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.
Replied by DenisChenu on topic cascading array filters
No,tpartner wrote: You cannot use a less-than operator on a string. Less than "A4" doesn't make any sense.
…
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.