As shown above, I have a event form where I register participant information.
Now I want Age to be calculated from Date of birth field and directly put below the data of birth field. How do I do it ??
Thank you @Eyuel_Nigussie for posting.
You can simply do this by using program rules. You can use the function d2:yearsBetween which will produce the number of years between the date of birth and the current date.
Here is a quick explanation about the d2:yearsBetween function:
You can read more in the documentation:
You can also check similar examples in DHIS2 PLAY (https://play.dhis2.org/)
Thanks @mutali by attribute you mean data element right?
It actually depends on the place of the field. If it’s in the registration page so it’s a Tracked Entity Attribute. If it’s inside the stage so it’ll be a Data Element.
Is the posted picture above from Tracker stage or the registration page?
@hanin.saadah Apologies for the late response>
Yes indeed it is in the event tracker stage’s form.