Welcome to the LimeSurvey Community Forum

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

countifop() interval

  • SIMOON
  • SIMOON's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #142812 by SIMOON
countifop() interval was created by SIMOON
Hey there,

I'm a bit confused with a conditionnal equation.

q2 is a list of numeric fields. Some are hidden (not ticked in q1).
In q3, I want to show the question only if there are more than 2 answer in q2 < 2015.

I'm using this equation:
countifop("<",2015,that.q2.value)

It seems to be working, but I count hidden field value as 0.

Is it possible to add an interval in this equation? Something like (countifop("<",2015,that.q2.value) && countifop(">",0,that.q2.value)) ?

Cheers.
The topic has been locked.
More
7 years 6 months ago #142826 by jelo
Replied by jelo on topic countifop() interval
What about just deducting the amount of empty/zero fields from the counting result?
Code:
(countifop("<",2015,that.q2.value)-countifop("<=",0,that.q2.value))

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu, SIMOON
The topic has been locked.
  • SIMOON
  • SIMOON's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #142841 by SIMOON
Replied by SIMOON on topic countifop() interval
That indeed should solve the problem. Gonna try on monday.
The topic has been locked.
  • SIMOON
  • SIMOON's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago - 7 years 6 months ago #142856 by SIMOON
Replied by SIMOON on topic countifop() interval
This equation is good indeed, thank you jelo
I'm displaying this in a question {(countifop("<",2015,that.q2.value)-countifop("<=",0,that.q2.value))} and get the attended value : 3
Then I add this filter in next question : ((countifop("<",2015,that.q2.value)-countifop("<=",0,that.q2.value))>2) but the question never show, even if the number is over 2.
Any idea why?
Last edit: 7 years 6 months ago by SIMOON.
The topic has been locked.
  • SIMOON
  • SIMOON's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #142898 by SIMOON
Replied by SIMOON on topic countifop() interval
Just to let you know I 'solved' the problem, it might help someone in the future :

I created a hidden question calc1 with numeric field (betweet q2 and q3), and added this to default value :
Code:
{(countifop("<",2015,that.q2.value)-countifop("<=",0,that.q2.value))}
I finally added this condition in my q3 :
Code:
((calc1.NAOK > "2"))

I'm curious to know why the equation ((countifop("<",2015,that.q2.value)-countifop("<=",0,that.q2.value))>2) doesn't work though.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose