dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #12274
Analytics query - filter on org unit group
Hello everyone,
I've a question on the analytics API. If I want to get a result for a
single org unit, I can do something like this:
https://play.dhis2.org/demo/api/analytics.json?dimension=dx:fbfJHSPpUQD&dimension=pe:LAST_MONTH&dimension=ou:ImspTQPwCqd
(in this case, asking for the ANC 1st visit result for the last month for
the Sierra Leone country).
This is actually giving me the aggregation of all the org unit in the
country, as per the documentation:
"For the organisation unit dimension the dimension items are the
organisation units and their sub-hierarchy - data will be aggregated for
all organisation units below the given organisation unit in the hierarchy."
Now in my case, I would like to run the same query (result for the whole
country), but limiting the org unit to a given group - let's say the CHCs.
The thing is: I don't want the results for each CHC, but still a single
result at the top level - I just want to include only the CHC in the
aggregation.
Can this be expressed using the DHIS2 API? I've the feeling I could use a
filter there, but could not manage to make it work.
Attempting to add filter=ou:OU_GROUP-CXw2yu5fodb to the above query result
to the API returning an error as: "Dimensions cannot be specified as
dimension and filter simultaneously" - and I don't see how I can say "give
me the aggregate for all units under Sierra Leone that are part of the CHC
group".
Any help or pointer would be most welcome.
Martin
--
*Martin Van Aken - **Freelance Enthusiast Developer*
Mobile : +32 486 899 652
Follow me on Twitter : @martinvanaken <http://twitter.com/martinvanaken>
Call me on Skype : vanakenm
Hang out with me : martin@xxxxxxxxxxxxxxxx
Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
Company website : www.joyouscoding.com
Follow ups