Table for SQL query for Indicators

Dear friends,

I am trying to output data of a questionnaire (called DataSetName here) from SQL View for the period of September 2016 from data values using the following code:

select dv.sourceid as organisationunitid, ou.name, ou.shortname, ou.code as CodeAC, de.name as intitule, pe.startdate, pe.enddate, coc.categoryoptioncomboname, dv.value from datavalue dv inner join organisationunit ou on (dv.sourceid=ou.organisationunitid) inner join dataelement de on (dv.dataelementid=de.dataelementid) inner join period pe on (pe.startdate=‘2016-09-01’) inner join _categoryoptioncomboname coc on (dv.categoryoptioncomboid=coc.categoryoptioncomboid) where (dv.dataelementid in (select dataelementid from datasetmembers where datasetid in (select datasetid from dataset where name=‘DataSetName’)));

If I would like to output data from indicator tables, on which table in DHIS2 should I base the select query?

Thank you for your support!

Kind Regards,

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.

···

Tantely.

Hello Raminosoa,

Analytics supports generation of query based on data, period and orgunit selection. You can use pivot table, select your periods, orgunits and indicators and use download option under advanced menu to download the query.

I can’t recall, but I think support for generation sql query even for indicators was added either in 2.23, 2.24 or 2.25 so you could also try to explore this option.

···

On 3 Feb 2017 11:05, “Raminosoa Rabemanantsoa, Tantely” traminosoa@mikolo.org wrote:

Dear friends,

I am trying to output data of a questionnaire (called DataSetName here) from SQL View for the period of September 2016 from data values using the following code:

select dv.sourceid as organisationunitid, ou.name, ou.shortname, ou.code as CodeAC, de.name as intitule, pe.startdate, pe.enddate, coc.categoryoptioncomboname, dv.value from datavalue dv inner join organisationunit ou on (dv.sourceid=ou.organisationunitid) inner join dataelement de on (dv.dataelementid=de.dataelementid) inner join period pe on (pe.startdate=‘2016-09-01’) inner join _categoryoptioncomboname coc on (dv.categoryoptioncomboid=coc.categoryoptioncomboid) where (dv.dataelementid in (select dataelementid from datasetmembers where datasetid in (select datasetid from dataset where name=‘DataSetName’)));

If I would like to output data from indicator tables, on which table in DHIS2 should I base the select query?

Thank you for your support!

Kind Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

Thank you John for the information.

Kind Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.

···

On Sun, Feb 5, 2017 at 6:47 PM, John Mukulu john.f.mukulu@gmail.com wrote:

Hello Raminosoa,

Analytics supports generation of query based on data, period and orgunit selection. You can use pivot table, select your periods, orgunits and indicators and use download option under advanced menu to download the query.

I can’t recall, but I think support for generation sql query even for indicators was added either in 2.23, 2.24 or 2.25 so you could also try to explore this option.

On 3 Feb 2017 11:05, “Raminosoa Rabemanantsoa, Tantely” traminosoa@mikolo.org wrote:

Dear friends,

I am trying to output data of a questionnaire (called DataSetName here) from SQL View for the period of September 2016 from data values using the following code:

select dv.sourceid as organisationunitid, ou.name, ou.shortname, ou.code as CodeAC, de.name as intitule, pe.startdate, pe.enddate, coc.categoryoptioncomboname, dv.value from datavalue dv inner join organisationunit ou on (dv.sourceid=ou.organisationunitid) inner join dataelement de on (dv.dataelementid=de.dataelementid) inner join period pe on (pe.startdate=‘2016-09-01’) inner join _categoryoptioncomboname coc on (dv.categoryoptioncomboid=coc.categoryoptioncomboid) where (dv.dataelementid in (select dataelementid from datasetmembers where datasetid in (select datasetid from dataset where name=‘DataSetName’)));

If I would like to output data from indicator tables, on which table in DHIS2 should I base the select query?

Thank you for your support!

Kind Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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