← Back to team overview

dhis2-users team mailing list archive

Re: Insight on program indicator and rule

 

Hi Natalie,

In addition to Markus advice above, also check the you use of brackets,
they are not balanced

(d2:daysBetween(A{Date of birth},V{enrollment_date}) / 365) in this
expression, you are dividing before executing and calcultating the entire
days between, should be

(d2:daysBetween(A{Date of birth},V{enrollment_date})) / 365

But better to use years between as Markus advises

Regards

Prosper Behumbiize, MPH
DHIS2 Implementation Adviser| HISP Uganda
prosper@xxxxxxxxxxxxxx <ptb3000@xxxxxxxxx> | prosper@xxxxxxxxx | Skype:
prospertb

On Thu, Mar 15, 2018 at 9:19 PM, Markus Bekken <markus@xxxxxxxxx> wrote:

> Hi there Natalie!
> Your program indicator looks all good. Can it be that the aggregation type
> is not "Count"? If your expression is a count, then the aggregation type
> needs to be "Count" or "Custom" for advanced cases.
> Tip: There is also a d2:yearsBetween function.
>
> For the program rule, I wonder if your A{Agree to be contacted} field
> might be of datatype "Yes/No"? If so, the correct syntax would be:
> A{Agree to be contacted} == false
>
> What version of DHIS2 are you on?
>
> Best regards,
> Markus
>
> 15. mar. 2018 kl. 18:33 skrev Natalie Tibbels <ntibbel1@xxxxxxx>:
>
> Hi all,
> Wondering if anyone could help with an indicator and a program rule.
>
> *What is wrong with this indicator (to calculate age from date of birth):*
> Want to count total enrollments where age is 35-39
>
> Expression:
> V{enrollment_count}
>
> Filter:
> (d2:daysBetween(A{Date of birth},V{enrollment_date}) / 365) >= 35 and
> (d2:daysBetween(A{Date of birth},V{enrollment_date}) / 365) <= 39
>
> [In the actual expression, the date of birth is the UID for date of birth]
>
> It’s producing no data but there should be some – think I’m making a
> simple mistake.
>
>
> *What is wrong with this program rule:*
> If the person says "no" for agreement to be contacted, hide the phone
> number field
>
> Name: Hide phone number field
>
> Expression: A{Agree to be contacted} == 'No'
>
> BUT, when I test it, if I click “Yes, agree to be contacted” the phone
> number disappears and if I click “No” the phone number remains. So the
> opposite of what I want….
>
> Thanks for any suggestions!
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References