- Posts: 10
- Thank you received: 4
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
countifop() interval
- SIMOON
- Topic Author
- Offline
- New Member
Less
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.
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.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
7 years 6 months ago #142826
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 4
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 4
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?
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 4
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 :
I finally added this condition in my q3 :
I'm curious to know why the equation ((countifop("<",2015,that.q2.value)-countifop("<=",0,that.q2.value))>2) doesn't work though.
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))}
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.