Calculated Field

I am using a calculated field to display “CALL” or “OK” with the following
code if(today()-/data/first_menses>180,“CALL”,“OK”). However, if I have
more than 180, I am still getting “OK”, I was expecting “CALL.”

Any idea?

You may have to concert /data/first_menses into a date first. Have you tried :

if(today()-date(/data/first_menses)>180,“CALL”,“OK”) ?

If not, maybe you need to convert the calculation into an integer, in this case it
would be :

if(int(today()-/data/first_menses)>180,“CALL”,“OK”)

··· On Sunday 11 January 2015 22:14:07 Bibek Adhikari wrote: > I am using a calculated field to display "CALL" or "OK" with the following > code *if(today()-/data/first_menses>180,"CALL","OK")*. However, if I have > more than 180, I am still getting "OK", I was expecting "CALL."


Charles Flèche
mHealth Advisor
Télécoms Sans Frontières http://www.tsfi.org
Première Urgence - Aide Médicale Internationale http://www.pu-ami.org

Thank worked thank you so much Charles.

··· On Monday, January 12, 2015 at 12:09:50 PM UTC+5:45, Charles Flèche wrote: > > On Sunday 11 January 2015 22:14:07 Bibek Adhikari wrote: > > > I am using a calculated field to display "CALL" or "OK" with the > following > > > code *if(today()-/data/first_menses>180,"CALL","OK")*. However, if I have > > > more than 180, I am still getting "OK", I was expecting "CALL." > > > > > > You may have to concert /data/first_menses into a date first. Have you > tried : > > > > if(today()-date(/data/first_menses)>180,"CALL","OK") ? > > > > If not, maybe you need to convert the calculation into an integer, in this > case it would be : > > > > if(int(today()-/data/first_menses)>180,"CALL","OK") > > > > -- > > Charles Flèche > > mHealth Advisor > > Télécoms Sans Frontières http://www.tsfi.org > > Première Urgence - Aide Médicale Internationale http://www.pu-ami.org > > >