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
  • Balztry1's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 weeks ago #195501 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..

File Attachment:

File Name: TESTS.txt
File Size:4 KB
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 weeks ago #195504 by DenisChenu
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
  • Balztry1's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 weeks ago #195505 by Balztry1
Ill'try
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 weeks ago #195508 by Joffm
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

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 weeks ago #195511 by DenisChenu
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
  • Balztry1's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 weeks ago #195512 by Balztry1
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)
The topic has been locked.
  • Balztry1
  • Balztry1's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 weeks ago #195513 by Balztry1
Good Morning Joffm,
i'm sorry, I do not understand if what i'm trying to do is possible or not..
The topic has been locked.
  • Balztry1
  • Balztry1's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 weeks ago #195515 by Balztry1
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)
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 weeks ago #195516 by DenisChenu

Balztry1 wrote: Tried with this.. nothing still not validate if i put just one value in the array..

Review your parenthesis and the logiu,

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
  • Balztry1's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 weeks ago #195518 by Balztry1
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))
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 weeks ago #195520 by Joffm
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

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.

Lime-years ahead

Online-surveys for every purse and purpose