Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Relevance with nested conditions

Relevance with nested conditions 1 Jahr 1 Monat her #99865

  • nfuria
  • nfurias Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 14
  • Dank erhalten: 1
  • Karma: 1
I have a question that must appears only when some nested conditions are satisfied.
The equation I need is:
(s1.NAOK == "N") or
(s1.NAOK == "Y" and (
( s2>1 && sum(that.s72) == s2) or
( s2>0 && count(s71) > 0)
)
)
But this doesn't works.
Even a simplified version fails but runs in a unexpected way:
(s1.NAOK == "N") or (s1.NAOK == "Y") :: runs ok
(s1.NAOK == "N") or (s1.NAOK == "Y" && s2>0) :: only 2nd condition works

Are there some problem with the use of "and" or "or"?

These conditions are already used in some more validations without problems.
Letzte Änderung: 1 Jahr 1 Monat her von nfuria. Begründung: complement
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Relevance with nested conditions 1 Jahr 1 Monat her #99876

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4281
  • Dank erhalten: 807
  • Karma: 370
Try replacing "&&" with"AND". I have encountered intermittent problems when using ampersands.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Relevance with nested conditions 1 Jahr 1 Monat her #99884

  • nfuria
  • nfurias Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 14
  • Dank erhalten: 1
  • Karma: 1
I tried all the combinations possible, using &&, AND, ||, OR.
None works.

I think I can use javascript but I don't know how to verify the answer of a previous question.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Relevance with nested conditions 1 Jahr 3 Wochen her #100374

  • nfuria
  • nfurias Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 14
  • Dank erhalten: 1
  • Karma: 1
Solved. As some questions could be hidden, it's necessary to use the "NAOK" suffix.
The correct equation becomes:
(s1 == "N") or
(s1 == "Y" and (
( s2.NAOK>1 && sum(that.s72.NAOK) == s2.NAOK) or
( s2.NAOK>0 && count(s71.NAOK) > 0)
)
)
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.121 Sekunden
Donation Image