- Posts: 28
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Validating subquestions based on values of a before array
- Balztry1
- Topic Author
- Offline
- Junior Member
Less
More
4 years 1 month ago #195501
by Balztry1
Validating subquestions based on values of a before array was created by Balztry1
Good Morning to everyone,
as subject, i'm trying to validate subquestions, by an answer gived before in an array. These subquestions have
relevance based on the same cells where i need the validation.
What i'm trying to do is to validate the subquestion only if the inserted number is >= (ge) than the one inserted in the
array.
i've reached the point with this validation equation:
CatRig20ta_SQ001 ge Trst4_SY1_SQ001 or
CatRig20ta_SQ003 ge Trst4_SY1_SQ002 or
CatRig20ta_SQ005 ge Trst4_SY1_SQ003 or
CatRig20ta_SQ007 ge Trst4_SY1_SQ004 or
CatRig20ta_SQ009 ge Trst4_SY1_SQ005 or
CatRig20ta_SQ011 ge Trst4_SY1_SQ006 or
CatRig20ta_SQ013 ge Trst4_SY1_SQ007
the problem is that survey don't let me go ahed if I let some cells of the array empty..
I've tried to solve that in many ways (file attached named TESTS) but never be able to, by putting the equation in
"question validation" or in "subquestions validation"..
i'll attach lss file of the survey..
version is 3.17.7+190627
Where i'm wrong? What i'm missing?
Thank you so much for your help..
as subject, i'm trying to validate subquestions, by an answer gived before in an array. These subquestions have
relevance based on the same cells where i need the validation.
What i'm trying to do is to validate the subquestion only if the inserted number is >= (ge) than the one inserted in the
array.
i've reached the point with this validation equation:
CatRig20ta_SQ001 ge Trst4_SY1_SQ001 or
CatRig20ta_SQ003 ge Trst4_SY1_SQ002 or
CatRig20ta_SQ005 ge Trst4_SY1_SQ003 or
CatRig20ta_SQ007 ge Trst4_SY1_SQ004 or
CatRig20ta_SQ009 ge Trst4_SY1_SQ005 or
CatRig20ta_SQ011 ge Trst4_SY1_SQ006 or
CatRig20ta_SQ013 ge Trst4_SY1_SQ007
the problem is that survey don't let me go ahed if I let some cells of the array empty..
I've tried to solve that in many ways (file attached named TESTS) but never be able to, by putting the equation in
"question validation" or in "subquestions validation"..
i'll attach lss file of the survey..
version is 3.17.7+190627
Where i'm wrong? What i'm missing?
Thank you so much for your help..
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 1 month ago #195504
by DenisChenu
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 Validating subquestions based on values of a before array
Something like this ?
Code:
( is_empty(CatRig20ta_SQ001.NAOK) or is_empty(Trst4_SY1_SQ001.NAOK) or (CatRig20ta_SQ001.NAOK ge Trst4_SY1_SQ001.NAOK) ) AND ... ...
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 following user(s) said Thank You: Balztry1
The topic has been locked.
- Balztry1
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 1
4 years 1 month ago #195505
by Balztry1
Replied by Balztry1 on topic Validating subquestions based on values of a before array
Ill'try
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12886
- Thank you received: 3965
4 years 1 month ago #195508
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Validating subquestions based on values of a before array
To explain:
If the cell is empty, the value is not defined.
So you cannot compare this to another value, nor can you sum up or calculate a mean.
Therefore LS uses the NAOK (Not Applicable is OK)
manual.limesurvey.org/Expression_Manager#Usage_of_NAOK
Joffm
If the cell is empty, the value is not defined.
So you cannot compare this to another value, nor can you sum up or calculate a mean.
Therefore LS uses the NAOK (Not Applicable is OK)
manual.limesurvey.org/Expression_Manager#Usage_of_NAOK
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 1 month ago #195511
by DenisChenu
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 Validating subquestions based on values of a before array
More is_empty functuion usage here , no ?
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.
- Balztry1
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 1
4 years 1 month ago #195512
by Balztry1
Replied by Balztry1 on topic Validating subquestions based on values of a before array
Tried with this.. nothing still not validate if i put just one value in the array..
is_empty(Trst4_SY1_SQ001.NAOK) or
is_empty(Trst4_SY1_SQ002.NAOK) or
is_empty(Trst4_SY1_SQ003.NAOK) or
is_empty(Trst4_SY1_SQ004.NAOK) or
is_empty(Trst4_SY1_SQ005.NAOK) or
is_empty(Trst4_SY1_SQ006.NAOK) or
is_empty(Trst4_SY1_SQ007.NAOK) AND
(CatRig20ta_SQ001 ge Trst4_SY1_SQ001) or
(CatRig20ta_SQ003 ge Trst4_SY1_SQ002) or
(CatRig20ta_SQ005 ge Trst4_SY1_SQ003) or
(CatRig20ta_SQ007 ge Trst4_SY1_SQ004) or
(CatRig20ta_SQ009 ge Trst4_SY1_SQ005) or
(CatRig20ta_SQ011 ge Trst4_SY1_SQ006) or
(CatRig20ta_SQ013 ge Trst4_SY1_SQ007)
is_empty(Trst4_SY1_SQ001.NAOK) or
is_empty(Trst4_SY1_SQ002.NAOK) or
is_empty(Trst4_SY1_SQ003.NAOK) or
is_empty(Trst4_SY1_SQ004.NAOK) or
is_empty(Trst4_SY1_SQ005.NAOK) or
is_empty(Trst4_SY1_SQ006.NAOK) or
is_empty(Trst4_SY1_SQ007.NAOK) AND
(CatRig20ta_SQ001 ge Trst4_SY1_SQ001) or
(CatRig20ta_SQ003 ge Trst4_SY1_SQ002) or
(CatRig20ta_SQ005 ge Trst4_SY1_SQ003) or
(CatRig20ta_SQ007 ge Trst4_SY1_SQ004) or
(CatRig20ta_SQ009 ge Trst4_SY1_SQ005) or
(CatRig20ta_SQ011 ge Trst4_SY1_SQ006) or
(CatRig20ta_SQ013 ge Trst4_SY1_SQ007)
The topic has been locked.
- Balztry1
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 1
4 years 1 month ago #195513
by Balztry1
Replied by Balztry1 on topic Validating subquestions based on values of a before array
Good Morning Joffm,
i'm sorry, I do not understand if what i'm trying to do is possible or not..
i'm sorry, I do not understand if what i'm trying to do is possible or not..
The topic has been locked.
- Balztry1
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 1
4 years 1 month ago #195515
by Balztry1
Replied by Balztry1 on topic Validating subquestions based on values of a before array
my last try..
i'm sure i'm missing something.. maybe i can't do what i'm planning too..(?)
is_empty(Trst4_SY1_SQ001.NAOK) or
is_empty(Trst4_SY1_SQ002.NAOK) or
is_empty(Trst4_SY1_SQ003.NAOK) or
is_empty(Trst4_SY1_SQ004.NAOK) or
is_empty(Trst4_SY1_SQ005.NAOK) or
is_empty(Trst4_SY1_SQ006.NAOK) or
is_empty(Trst4_SY1_SQ007.NAOK) AND
(CatRig20ta_SQ001.NAOK ge Trst4_SY1_SQ001.NAOK) or
(CatRig20ta_SQ003.NAOK ge Trst4_SY1_SQ002.NAOK) or
(CatRig20ta_SQ005.NAOK ge Trst4_SY1_SQ003.NAOK) or
(CatRig20ta_SQ007.NAOK ge Trst4_SY1_SQ004.NAOK) or
(CatRig20ta_SQ009.NAOK ge Trst4_SY1_SQ005.NAOK) or
(CatRig20ta_SQ011.NAOK ge Trst4_SY1_SQ006.NAOK) or
(CatRig20ta_SQ013.NAOK ge Trst4_SY1_SQ007.NAOK)
i'm sure i'm missing something.. maybe i can't do what i'm planning too..(?)
is_empty(Trst4_SY1_SQ001.NAOK) or
is_empty(Trst4_SY1_SQ002.NAOK) or
is_empty(Trst4_SY1_SQ003.NAOK) or
is_empty(Trst4_SY1_SQ004.NAOK) or
is_empty(Trst4_SY1_SQ005.NAOK) or
is_empty(Trst4_SY1_SQ006.NAOK) or
is_empty(Trst4_SY1_SQ007.NAOK) AND
(CatRig20ta_SQ001.NAOK ge Trst4_SY1_SQ001.NAOK) or
(CatRig20ta_SQ003.NAOK ge Trst4_SY1_SQ002.NAOK) or
(CatRig20ta_SQ005.NAOK ge Trst4_SY1_SQ003.NAOK) or
(CatRig20ta_SQ007.NAOK ge Trst4_SY1_SQ004.NAOK) or
(CatRig20ta_SQ009.NAOK ge Trst4_SY1_SQ005.NAOK) or
(CatRig20ta_SQ011.NAOK ge Trst4_SY1_SQ006.NAOK) or
(CatRig20ta_SQ013.NAOK ge Trst4_SY1_SQ007.NAOK)
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 1 month ago #195516
by DenisChenu
Here you just need one empty value and it's validated.
And : it's totally different then my proposition .....
Denis
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 Validating subquestions based on values of a before array
Review your parenthesis and the logiu,Balztry1 wrote: Tried with this.. nothing still not validate if i put just one value in the array..
Here you just need one empty value and it's validated.
And : it's totally different then my proposition .....
Denis
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 following user(s) said Thank You: Balztry1
The topic has been locked.
- Balztry1
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 1
4 years 1 month ago #195518
by Balztry1
Replied by Balztry1 on topic Validating subquestions based on values of a before array
IT WORKED!!!! thank you Denis!! I didn't get you're suggestion before!!!
Thank you so much
(is_empty(CatRig20ta_SQ001.NAOK) or is_empty(Trst4_SY1_SQ001.NAOK) or
(CatRig20ta_SQ001.NAOK ge Trst4_SY1_SQ001.NAOK)) and
(is_empty(CatRig20ta_SQ003.NAOK) or is_empty(Trst4_SY1_SQ002.NAOK) or
(CatRig20ta_SQ003.NAOK ge Trst4_SY1_SQ002.NAOK)) and
(is_empty(CatRig20ta_SQ005.NAOK) or is_empty(Trst4_SY1_SQ003.NAOK) or
(CatRig20ta_SQ005.NAOK ge Trst4_SY1_SQ003.NAOK)) and
(is_empty(CatRig20ta_SQ007.NAOK) or is_empty(Trst4_SY1_SQ004.NAOK) or
(CatRig20ta_SQ007.NAOK ge Trst4_SY1_SQ004.NAOK)) and
(is_empty(CatRig20ta_SQ009.NAOK) or is_empty(Trst4_SY1_SQ005.NAOK) or
(CatRig20ta_SQ009.NAOK ge Trst4_SY1_SQ005.NAOK)) and
(is_empty(CatRig20ta_SQ011.NAOK) or is_empty(Trst4_SY1_SQ006.NAOK) or
(CatRig20ta_SQ011.NAOK ge Trst4_SY1_SQ006.NAOK)) and
(is_empty(CatRig20ta_SQ013.NAOK) or is_empty(Trst4_SY1_SQ007.NAOK) or
(CatRig20ta_SQ013.NAOK ge Trst4_SY1_SQ007.NAOK))
Thank you so much
(is_empty(CatRig20ta_SQ001.NAOK) or is_empty(Trst4_SY1_SQ001.NAOK) or
(CatRig20ta_SQ001.NAOK ge Trst4_SY1_SQ001.NAOK)) and
(is_empty(CatRig20ta_SQ003.NAOK) or is_empty(Trst4_SY1_SQ002.NAOK) or
(CatRig20ta_SQ003.NAOK ge Trst4_SY1_SQ002.NAOK)) and
(is_empty(CatRig20ta_SQ005.NAOK) or is_empty(Trst4_SY1_SQ003.NAOK) or
(CatRig20ta_SQ005.NAOK ge Trst4_SY1_SQ003.NAOK)) and
(is_empty(CatRig20ta_SQ007.NAOK) or is_empty(Trst4_SY1_SQ004.NAOK) or
(CatRig20ta_SQ007.NAOK ge Trst4_SY1_SQ004.NAOK)) and
(is_empty(CatRig20ta_SQ009.NAOK) or is_empty(Trst4_SY1_SQ005.NAOK) or
(CatRig20ta_SQ009.NAOK ge Trst4_SY1_SQ005.NAOK)) and
(is_empty(CatRig20ta_SQ011.NAOK) or is_empty(Trst4_SY1_SQ006.NAOK) or
(CatRig20ta_SQ011.NAOK ge Trst4_SY1_SQ006.NAOK)) and
(is_empty(CatRig20ta_SQ013.NAOK) or is_empty(Trst4_SY1_SQ007.NAOK) or
(CatRig20ta_SQ013.NAOK ge Trst4_SY1_SQ007.NAOK))
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12886
- Thank you received: 3965
4 years 1 month ago #195520
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Validating subquestions based on values of a before array
Hi,
your expression is really easy, straightforward, even if it looks long.
But check the level of operators
manual.limesurvey.org/ExpressionScript_-_Presentation#Operators
"AND" and "OR" and structure by parenthesis.
Joffm
your expression is really easy, straightforward, even if it looks long.
But check the level of operators
manual.limesurvey.org/ExpressionScript_-_Presentation#Operators
"AND" and "OR" and structure by parenthesis.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.