Problem with the d2:condition function in program operator

Hello @Markus
I know this is an old thread but would like to take it back since we´re experimenting a similar issue in DHIS2 2.31

The expression we´re using is as follows
(d2:condition(’#{XHb8oH6AjDT.y37QCBqibki}==1’,1,0)*2)/(d2:condition(‘d2:hasValue(‘XHb8oH6AjDT.y37QCBqibki’)==true’,1,0)*2)

The DE we´re using are Yes/No. The context of this indicator is related to a questionnaire with compulsory questions. All responded (yes/no) are considered in the numerator, while in the denominator only those responded, excluding those that for a logic in the questionnaire have been hidden - null)

any thought why the expression does not work properly?

Thanks much!

Ana María

1 Like

hi everyone
I replied myself to let you all know we could sort out the issue reported. Instead using the d2 condition, which did not work, we are using the value_count variable which counts only the No Nulls value, which is what we were looking for the denominator construction.

So, sharing in case is useful for someone else!

Best

1 Like

Thank you for your feedback @anamariaelsal!

Best,
James.