Good to know, thanks. To be fair - the doc does not refer to any support of a null operator, I just tried my luck there.
I’ll try Aaron logic - if I can create an indicator whose value would be 0 when the ‘main’ indicator has no value, I got a proxy for my query which is all I need.
I’ll follow the jira anyway.
···
On Tue, Feb 6, 2018 at 5:46 AM, Prosper BT ptb3000@gmail.com wrote:
Dear Martin,
Refer to this jira issues DHIS2-1219 requesting additional support for Null and missing in Events report filters
Its to be done in 2.30
Regards
–
Prosper Behumbiize, MPH
DHIS2 Implementation Adviser| HISP Uganda
prosper@hispuganda.org | prosper@dhis2.org | Skype: prospertb
On Tue, Feb 6, 2018 at 12:57 AM, Abyot Asalefew Gizaw abyot@dhis2.org wrote:
Hi,
Seems we have a bug there… please file a JIRA issue and we would address it as soon as we can.
Otherwise, since 2.25 on we have introduced support to filter events based on data element values. You can play around with columns of the event grid in event capture app to see the request url sent to server. Below is an example
https://play.dhis2.org/dev/api/28/events/query.json?orgUnit=DiszpKrYNg8&programStage=Zj7UnCAulEk&filter=qrur9Dvnyt5:GT:10:LT:100&dataElement=qrur9Dvnyt5,S33cRBsnXPo,fWIAEtYVEGk,K6uUAvq500H&order=lastUpdated:desc&pageSize=50&page=1&totalPages=true
It goes by something like
api/events/query?filter=DATAELEMENT_UID:OPERATOR:VALUE
api/events/query?filter=DATAELEMENT_UID:EQ:NULL
Unfortunately, we have a bug in handling NULL as part of the query parameter.
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp
–
Abyot A. Gizaw.
Senior Engineer, DHIS2
University of Oslo
http://www.dhis2.org
On Mon, Feb 5, 2018 at 10:01 PM, Martin Van Aken martin@joyouscoding.com wrote:
Ok, got it, I was missing some context. Looks an interesting way to actually tackle some of the “queries” I have to do for a project.
Thanks a lot!
Martin
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp
On Mon, Feb 5, 2018 at 9:56 PM, Aaron C White aaroncwhite@gmail.com wrote:
I just had to tackle something similar recently, so it’s fresh on my mind. The functions are built in to DHIS2 (but I believe are part of the JEXL library according to the docs). You would need to create the program indicator first, run analytics, and then request the program indicator instead of the data element in question. I don’t think you can use it to hit the analytics endpoint directly. You can find some examples and more detail here.
Aaron
–
**Martin Van Aken - **Freelance Enthusiast Developer
Mobile : +32 486 899 652
Follow me on Twitter : @martinvanaken
Call me on Skype : vanakenm
Hang out with me : martin@joyouscoding.com
Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
Company website : www.joyouscoding.com
–
Aaron C. White
919.522.5585
On Mon, Feb 5, 2018 at 3:48 PM, Martin Van Aken martin@joyouscoding.com wrote:
Would not have though of that approach - your examples uses the d2 JS library? Are those “operators” usable in a analytics/events/query filter string? (tried the “aggregate” null operator, but it did not work)
Thanks !
Martin
On Mon, Feb 5, 2018 at 6:24 PM, Aaron C White aaroncwhite@gmail.com wrote:
Martin,
What if you made a program indicator with inverse logic? Something like “!d2:hasValue(#{your_de_uid})”, since if the value is numeric “d2:oizp(#{your_de_uid})”. d2:oizp returns 1 if the value is zero or positive and otherwise returns 0. I bet one of those or a combination would solve that problem.
Aaron
–
**Martin Van Aken - **Freelance Enthusiast Developer
Mobile : +32 486 899 652
Follow me on Twitter : @martinvanaken
Call me on Skype : vanakenm
Hang out with me : martin@joyouscoding.com
Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
Company website : www.joyouscoding.com
–
Aaron C. White
919.522.5585
On Mon, Feb 5, 2018 at 10:53 AM, Martin Van Aken martin@joyouscoding.com wrote:
Hi everyone,
We are interested to get an event report with all events where a specific data item has no value (ie, not 0, no value at all). We’re on 2.26, an all the conditins available are <, <=, =, > etc.
Putting “=” then an empty field does not filter anything, and in this case “0” is taken as a separated value than “no value”.
Is there any way to do this?
Thanks,
Martin
–
**Martin Van Aken - **Freelance Enthusiast Developer
Mobile : +32 486 899 652
Follow me on Twitter : @martinvanaken
Call me on Skype : vanakenm
Hang out with me : martin@joyouscoding.com
Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
Company website : www.joyouscoding.com
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp
**Martin Van Aken - **Freelance Enthusiast Developer
Mobile : +32 486 899 652
Follow me on Twitter : @martinvanaken
Call me on Skype : vanakenm
Hang out with me : martin@joyouscoding.com
Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
Company website : www.joyouscoding.com