Hi everyone,
I’m trying to work out if it is possible to access the values of the numerator and denominator of an indicator via an API call. These values show up in a downloaded csv if it is created via the visualization App, but are not returned in the JSON of an API call, even when using the includeNumDen
parameter. I’m not sure if this is an issue of JSON vs. csv or API vs. vis app, but just want to know if this is possible.
An example using the 2.41 play demo. When I filter the data via the visualization app and then download a csv, I have access to the Numerator and Denominator:
Data,Period,Value,Numerator,Denominator,Factor,Multiplier,Divisor
joIQbN4L1Ok,202308,27.03,20.0,74.0,100.0,100,1
joIQbN4L1Ok,202401,34.62,9.0,26.0,100.0,100,1
joIQbN4L1Ok,202403,32.08,17.0,53.0,100.0,100,1
joIQbN4L1Ok,202404,31.43,11.0,35.0,100.0,100,1
joIQbN4L1Ok,202405,31.82,14.0,44.0,100.0,100,1
joIQbN4L1Ok,202406,44.71,38.0,85.0,100.0,100,1
joIQbN4L1Ok,202407,33.33,21.0,63.0,100.0,100,1
However, when I access the data via the API call, I do not:
https://play.im.dhis2.org/stable-2-41-0-1/api/analytics/dataValueSet.json?dimension=dx%3AjoIQbN4L1Ok&dimension=pe%3ALAST_12_MONTHS&dimension=ou%3AiGHlidSFdpu&showHierarchy=false&hierarchyMeta=false&includeMetadataDetails=true&includeNumDen=true&skipRounding=false&completedOnly=false
This returns:
"dataValues": [
{
"dataElement": "joIQbN4L1Ok",
"period": "202308",
"orgUnit": "iGHlidSFdpu",
"value": "27.03",
"created": "2024-08-21",
"lastUpdated": "2024-08-21",
"comment": "[aggregated]",
"followup": false
},
{
"dataElement": "joIQbN4L1Ok",
"period": "202401",
"orgUnit": "iGHlidSFdpu",
"value": "34.62",
"created": "2024-08-21",
"lastUpdated": "2024-08-21",
"comment": "[aggregated]",
"followup": false
}...
Any suggestions on how to access these values via the API?