Need sql query to set all data element store zero value

Hi everyone,

I have an 2.23 instance with 1234 data elements, with store zero value not active. As I have many data element to deal with, could someone help me with a query to set them all?

Thanks.

Hi Hussein,

Its work, good. Thank you.

···

2017-01-11 12:34 GMT+01:00 Seid Hussein seid.hisp@gmail.com:

Hi Carlos,

Try the following query.

UPDATE dataelement SET zeroissignificant = true;

It will update all dataelements and make them to store zero as data value. But since you may have non-number data value types, I would add a filter to change only those that are numbers like the following query.

UPDATE dataelement SET zeroissignificant = true AND valuetype in (‘INTEGER_ZERO_OR_POSITIVE’,‘INTEGER’,‘NUMBER’);

You can filter your query if it belongs to a specific dataset or data element group by using the WHERE filter (WHERE dataelementid in SELECT dataelementid from datasetmembers WHERE datasetid = ???)

Regards,

Seid,

On Wed, Jan 11, 2017 at 1:49 PM, vunda limbe vundalon@gmail.com wrote:

Hi everyone,

I have an 2.23 instance with 1234 data elements, with store zero value not active. As I have many data element to deal with, could someone help me with a query to set them all?

Thanks.


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