Analytics API

Hello all,

I’ve an option set with two values (Done and Update)

I’m trying to use NE (Not Equal To) operator with analystic API to return all events that do not have a value ‘Done’. I want to get events which have no value or that the value is ‘update’ but I get nothing in result.

Here is the query




1 Like

Hey @didate
It’s always great to hear from you. I’d start by using something like:

I can see here all the info needed for all events recorded in the stage, but I don’t know how to filter all these results in the API get request (maybe you can share with me the parameters you’d use here) but if you add .csv after the word query you’ll be able to filter it in a sheet.

I hope this helps a bit. ( :

You can see the result is in a “grid query” so if you want more info on this, please search for Event grid query here: WebAPI events | DHIS2 Docs

Hello @Gassim, Thank you so much :grinning:

I probably didn’t explain my problem very well (my English is poor :grin:).

In fact I’m doing an automatic script that takes the data from dhis 2 (with over 1,000,000 enrollments) to another database. The script runs every day at midnight.
Each time I process an enrollment I put its status in dhis 2 at DONE, which will prevent the script from looping back to all enrollments.

So if there is an update on an enrollment in dhis 2, for it to be processed by the script, its status must be set to UPDATE in dhis 2.

So that’s kind of the scenario.

1 Like

You’re welcome! Your English is pretty good :relaxed: It’s very interesting that you are creating scripts, maybe discuss the script with other developers in the #development category?