I am experiencing an issue with the Data Exchange App on DHIS2 v2.42.5 where a program indicator configured with decimals: 0 is returning values with a decimal point (e.g., 2.0 instead of 2) during data exchange. This causes a data type mismatch with the target data element, which expects an integer value, and the exchange fails as a result.
Program indicator values before data exchange.
View during data exchange
Program Indicator details:
Expression: V{event_count}
Aggregation type: COUNT
Decimals: 0
Expected behavior: The exchanged value should be a whole number (e.g., 2).
Actual behavior: The value is sent with a decimal point (e.g., 2.0), causing a type mismatch.
Has anyone else encountered this? Any workarounds would be appreciated while we investigate further.
Thanks @Kenyuri for reporting. Sorry for the difficulties here.
Could you try reproducing this error on our 2.42 demo instance (Login app | DHIS2).
I tried a program indicator in v44 and did not observe an issue, but there may be an issue in v42. If you can provide some steps for how to recreate the problem, we’ll be able to help fix it.
Update: setting decimals: 0 on the program indicator resolved it for us - but two caveats that weren’t obvious:
You have to clear the analytics cache (and ideally re-run analytics) after making the change. The old cached values were still being served with the trailing .0, so it looked like nothing had changed until the cache cleared.
Give it time to propagate. It wasn’t instant - the corrected integer values only showed up in the exchange after analytics had fully regenerated.
Once both of those happened, the value came through as 2 instead of 2.0 and the exchange stopped failing on the type mismatch.
cc: @Gassim