Do you have a datavalue entered for the given Data Element, period & org unit? If you are using disaggregations in your data entry form, then you need to pass additional parameter ‘co’ to get the data value.
Hi @didate
You are right. What version of dhis2 are you using? This might be a bug issue because the same error appears on play even though the parameters are correct and the value does exist.
@Jason supported this issue and responded that this endpoint requires category option (if you see the api/analytics endpoint it lists the related category options.
Our goal is to migrate part of the data, not all of the instance’s data.
I’m going to continue with the analytics API, it works well. It also allows us to retrieve data for several months at the same time, which reduces the number of requests on the source instance.
You can also make use of Import/Export app to export and import the data needed from one DHIS instance to another. You also get the flexibility to mention the date range and select org units and datasets that need to be exported.
Import/Export app is a great app. But in my use case I don’t want to migrate all dataelement of the dataset. The Dataset in the old instance contains more than 4000 data elements and I only want to migrate data from around 900 data elements. And also I have to make a mapping between the data elements of the two instances.
That’s why I think it’s better to write a script that uses APIs to automate all this.