I need to be able to round (actually ceil) a division into the expression of the numerator of an Indicator, it seems impossible to do in DHIS2?
The expression is simply : Ceil(DE1/DE2) but d2:ceil() available in program indicator does not work (expression is dubbed as invalid), without any rounding function or a integer division is not possible to have a workaround. And if I would want to “bypass” this I am stuck by not being able to implement an indicator using the results of two others indicator.
d2:ceil works in program rules so there’s a way to make a program rule that would convert the value and assign it to a variable and then using it in the program indicator.
Alternatively, you could use a math calculation which will return the ceil: (#{DE1} + #{DE2} - 1)/(#{DE2})
I already tried the approximation and it does not work due to the fact than the division is not an integer division in DHIS2 :
if DE1 = 756 and DE2 = 56 then CEIL(756/56) = 14 and (756 + 56 - 1) / 56 = 14.482142857142858 is the division operator is not an integer division.
Do I have a misunderstanding about the nature of the division operator available in Indicator expression engine ?
Thanks for the idea but unfortunately, I am working with Datasets and Indicator not Program and Program Indicator (my life would have been easier :D). I don’t think there any way to round/floor/ceil a number into the expression engine of an Indicator due to the lack of functions and/or lack of integer division.
Apologies, I thought you’re using program indicator since it was mentioned in your first post. I’d need to look around and see if there’s a way in the aggregate.
It might be possible to create a feature request but maybe there’s a way of doing it, so let’s check first.
Sorry to hear that you’re facing an issue. This issue was in the deprecated data entry app. Could you please provide more details about the issue you are facing and which version of DHIS2 are you using? Are you using the new Data Entry app?
I am trying to a calculation and showing in single value in dashboard. after calculation its comes decimal and i want to remove .i tried all the way but failed . my version is 2.40. it would be very helpful for me if someone assist me help. @Gassim