Hello Community,
I am trying to obtain unique values of data element and their aggregated values from the current API. However, the API only returns three columns: data element, period, and value. This makes it impossible to get the desired output. Is it possible to program the API to return only two columns: data element and the sum of the data element value? My API is included below:
In that page you will be able to view all the parameters that can be used with the API endpoint. On the right side of the page there is a tool that you can use to format the API request and insert the values, and after inserting the values in the tool, you will see the API request formatted.
Thank you for your quick response. I research the link you provide but it does not seem to provide me the right answer as the API still included Dates. Could you tell me
1 - how to provide Start Date and end date to fetch data in the API and
2 - how to exclude the dates (dates can be used to filter data only) from result set and how to aggregate the value for each data element. For instance,
Dear @Samnang_Sao
Yes, you are correct in that the analytics API does not have any functionality to return distict values. The only way currently that I can think of would be with an SQL view which you could use to filter for distinct values. The other possibility would be to use a client (R/Python) to download the data via the analytics API and then determine the unique values.