Condition from result of an equation

6 months 2 weeks ago #199711
It works ! Thank you,
My relevance equation was not perfect but I still don't understand why it was not working.

Anyway, thank you very much !

6 months 2 weeks ago #199712 by holch

By the way: your age calculation fails if I was born in 1901.

I knew you were a pensioner, but I didn't expect that...

How high are the chances that someone born in 1901 is still alive, using this online questionnaire and requiring and MRI? I think one can risk it not to work from 1901 downwards. Hahahaha.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

6 months 2 weeks ago - 6 months 2 weeks ago #199714 by Joffm
No, I was thinking about setting a realistic minimum year.

You can set this by
"minimum date": "-75 years"
"maximum date": "now"

Now the drop down starts at 1900 and while testing I clicked something there.
But it's an interesting fact that I will investigate.
In that case the difference (time - mktime) exceeds the size of an integer (4294967295)

But I have the idea why the equation failed.
Here
(age>11 and age<50) or (age>49 and (QMenopause=="Y" and QMenopauseYear=="N")) or (age>49 and QMenopause=="N")
QMenopauseYear is not defined, if
QMenopause=="N"
age<50

So the whole equation will not work.
Therefore there is the NAOK.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 months 2 weeks ago by Joffm.

6 months 2 weeks ago #199757
Thank to all of you for the precious help !!

6 months 1 week ago #199860 by Joffm
{round(floor((time() - mktime(0,0,0,substr(G3dateOfBirth,5,2),substr(G3dateOfBirth,8,2),substr(G3dateOfBirth,0,4)))/(24*60*60))/365,0)}

this is better:
{floor(((strtotime(date("Y-m-d"))-strtotime(G3dateOfBirth))/86400)/365)}

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless