Re: [Dhis2-users] Pruning the OU hierarchy

2017-12-05 Thread Jason Pickering
Try this https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/delete_orgunittree_with_data.sql which will prune an entire branch of the orgunit tree. Regards, Jason On Tue, Dec 5, 2017 at 9:07 AM, Knut Staring wrote: > Hi everyone, > > Are there some easy ways of pruning an OrgUnit

Re: [Dhis2-users] Pruning the OU hierarchy

2017-12-05 Thread Knut Staring
Works nicely (I first mistakenly used organisationunitid instead of uid), except that the following part should be updated (I just removed it): EXECUTE 'DELETE FROM programstageinstance_outboundsms WHERE programstageinstanceid IN (SELECT programstageinstanceid FROM programstageinstance WHERE organ

Re: [Dhis2-users] Pruning the OU hierarchy

2017-12-05 Thread Knut Staring
Thanks! On Tue, Dec 5, 2017 at 1:15 PM, Jason Pickering wrote: > Try this > > https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/delete_ > orgunittree_with_data.sql > > which will prune an entire branch of the orgunit tree. > > Regards, > Jason > > > On Tue, Dec 5, 2017 at 9:07 AM,

[Dhis2-users] Pruning the OU hierarchy

2017-12-05 Thread Knut Staring
Hi everyone, Are there some easy ways of pruning an OrgUnit tree? Basically, I have a number of countries with varying numbers of subnational levels, but am only interested in one of the countries. I guess in previous DHIS2 versions I could have done a detailed metadata export. What would be a qu