Greetings, team!
In the program indicator, I am getting an error when summing data element values with decimal numbers.
My program indicator for calculating the sum of data element values was: sum(#{CdMlpOn2RMA.QxQurwAB8jT}).
Unfortunately, if the data element has decimal numbers, I am getting an error that: “cannot cast String to Double”.
dhis2 version: 2.36
Your assistance is highly appreciated.
Hi @Gassim,
I appreciate your quick reply.
I have a case where this DE, #CdMlpOn2RMA.QxQurwAB8jT, holds decimal numbers, eg 89.92. I’d like to set up a program indication to sum this DE (in the expression tab) after applying a filter.
Example: sum of all #{CdMlpOn2RMA.QxQurwAB8jT} where #{CdMlpOn2RMA.QxQurwAB8jT} > 70.
But the expression is invalid and am getting this error “Could not cast String ‘’ to Double”
NB: The expression is valid If the Data element values is a whole number,
I think all you need to do here: expression: #{CdMlpOn2RMA.QxQurwAB8jT} filter: #{CdMlpOn2RMA.QxQurwAB8jT}
And in the Program indicator details: aggregation type: Sum
Thank you so much. @Gassim
I realized that the problem is that my data element is a string (instead of a number) containing decimal numbers. Do you know if there is a way to convert the existing data from string to numbers?