We’re attempting to pull data from DHIS 2 via DHIS 2 SQL Views / Queries and want to be able to use “IN” clauses to filter the data. Is there a way to do this?
For example we want to create a SQL View or query to get tracked entity data values, but only for specific data elements. The number of data elements that will be used in a filter will vary.
I have been thinking for a while that we should create a new API version of the SQL view criteria/filtering that matches the syntax we have for the Web API object filtering:
Perhaps we could reuse some of the components we have for the Web API filter here.
Morten - what do you think?
regards,
Lars
···
On Wed, May 4, 2016 at 12:57 AM, Lorill Crees lcrees@2paths.com wrote:
Hi,
We’re attempting to pull data from DHIS 2 via DHIS 2 SQL Views / Queries and want to be able to use “IN” clauses to filter the data. Is there a way to do this?
For example we want to create a SQL View or query to get tracked entity data values, but only for specific data elements. The number of data elements that will be used in a filter will vary.
@Lars: possibly, at least the parsing logic… that said, most of the object filter stuff does automatic translation of properties etc… so it is only allowed to work on exposed properties, which I think is not good enough for SQLViews…
···
On Wed, May 4, 2016 at 8:30 PM, Lars Helge Øverland lars@dhis2.org wrote:
Hi Lorill,
good question - unfortunately, at the moment no.
This feature would clearly be useful though.
I have been thinking for a while that we should create a new API version of the SQL view criteria/filtering that matches the syntax we have for the Web API object filtering:
On Wed, May 4, 2016 at 12:57 AM, Lorill Crees lcrees@2paths.com wrote:
Hi,
We’re attempting to pull data from DHIS 2 via DHIS 2 SQL Views / Queries and want to be able to use “IN” clauses to filter the data. Is there a way to do this?
For example we want to create a SQL View or query to get tracked entity data values, but only for specific data elements. The number of data elements that will be used in a filter will vary.