I am trying to use a Hidden Value to calculate age using today's date and
the person's date of birth in order to use for display conditions.
I have been trying to use int((today() - date(/data/dob)) div 365.25),
which I found on CommCare's Help site, (in my app translates to
int((today() - date(/data/Registration/DOB)) div 365.25). I created a
Hidden Value called Age, however whenever I try to use Hidden Value in the
display condition for a question, the question simply doesn't appear.
Have you been able to verify that the calculation is working as expected?
One thing you can to troubleshoot this is to create a label question and
display the value of the calculation (as described on Display an Answer to a Previous Question - CommCare Public - CommCare Public).
You can delete the label question once you have confirmed that it is
working as expected and use the age hidden value in the display conditions.
Hope this helps!
Jeremy
ยทยทยท
On Fri, May 13, 2016 at 8:18 PM, Natalia Forbath wrote:
I am trying to use a Hidden Value to calculate age using today's date and
the person's date of birth in order to use for display conditions.
I have been trying to use int((today() - date(/data/dob)) div 365.25),
which I found on CommCare's Help site, (in my app translates to
int((today() - date(/data/Registration/DOB)) div 365.25). I created a
Hidden Value called Age, however whenever I try to use Hidden Value in the
display condition for a question, the question simply doesn't appear.