Re: [Dhis2-users] Validation Rules with zeros and nulls

2017-02-14 Thread Lars Helge Øverland
Hi Becky,

did you try creating a rule like this?


- left side missing value strategy is set to "never skip".
- left side expression is the relevant data element.

- operator is "greater than or equal to".

- right side missing value strategy is set to "never skip".
- right side expression is 0.




Lars






On Tue, Feb 14, 2017 at 10:21 PM, Smith, Rebecca A. <
rs3...@cumc.columbia.edu> wrote:

> Hi DHIS community,
>
>
>
> Could someone advise me on how to distinguish between a zero and a null in
> a validation rule?
>
>
>
> Basically, I want the validation to pass if a data value is not blank. It
> should pass even if the value is zero, as long as it’s is filled in. “Zero
> is significant” is on.
>
>
>
> I tried d2:hasValue from the program rules, but got the “expression is not
> well-formed” message. Is there a different way to check this in validation
> rules?
>
>
>
> Thanks!
>
> Becky
>
>
>
>
>
>
>
> Becky Smith
>
> Development-Operations Specialist
>
> ICAP at Columbia University
>
> Tel: 212.304.7109
>
> Email: rs3...@cumc.columbia.edu
>
>
>
> ___
> 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
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
l...@dhis2.org
http://www.dhis2.org 
___
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


Re: [Dhis2-users] Validation Rules with zeros and nulls

2017-02-14 Thread Antonia - Pro
Hi Becky,
in the program rules you can use the function d2:hasValue('') to
verify if the variable has value.

for example to check if the "MotherAge" is between 10 and 70 you can use
the rule

d2:hasValue('MotherAge') && (#{MotherAge} > 70|| #{MotherAge} < 10)

Regards,
antonia

 www.informa.pro - *Seguici su *LinkedIn

INFORMAPRO S.r.l. - via Luigi Rava 43,  Rome 00149 , Italy
tel. +39 06 5758926, fax +39  06 62207168, P.IVA IT08095781004
Skype: informa_antonia.bezenchek
Eng. Antonia Bezenchek - CIO - ICT Engineer

2017-02-14 22:21 GMT+01:00 Smith, Rebecca A. :

> Hi DHIS community,
>
>
>
> Could someone advise me on how to distinguish between a zero and a null in
> a validation rule?
>
>
>
> Basically, I want the validation to pass if a data value is not blank. It
> should pass even if the value is zero, as long as it’s is filled in. “Zero
> is significant” is on.
>
>
>
> I tried d2:hasValue from the program rules, but got the “expression is not
> well-formed” message. Is there a different way to check this in validation
> rules?
>
>
>
> Thanks!
>
> Becky
>
>
>
>
>
>
>
> Becky Smith
>
> Development-Operations Specialist
>
> ICAP at Columbia University
>
> Tel: 212.304.7109 <(212)%20304-7109>
>
> Email: rs3...@cumc.columbia.edu
>
>
>
> ___
> 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
>
>
___
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


[Dhis2-users] Validation Rules with zeros and nulls

2017-02-14 Thread Smith, Rebecca A.
Hi DHIS community,

Could someone advise me on how to distinguish between a zero and a null in a 
validation rule?

Basically, I want the validation to pass if a data value is not blank. It 
should pass even if the value is zero, as long as it's is filled in. "Zero is 
significant" is on.

I tried d2:hasValue from the program rules, but got the "expression is not 
well-formed" message. Is there a different way to check this in validation 
rules?

Thanks!
Becky



Becky Smith
Development-Operations Specialist
ICAP at Columbia University
Tel: 212.304.7109
Email: rs3...@cumc.columbia.edu

___
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


Re: [Dhis2-users] Error in GIS app DHIS2 2.26

2017-02-14 Thread Bjørn Sandvik
Hi Marc,

I've created a date format fix for 2.26 - could you try to upgrade your
instance to the latest revision, and check if it solves your problem?

https://jira.dhis2.org/browse/DHIS2-1038?filter=10200

Bjørn Sandvik
GIS developer, DHIS 2
University of Oslo
www.dhis2.org


On Tue, Feb 7, 2017 at 2:57 PM, Bjørn Sandvik  wrote:

> Hi Marc,
>
> Could you please test if the same error occurs on our demo instance also
> running 2.26: https://play.dhis2.org/demo/
> ("Inpatient morbidity and mortality" and "Malaria case registration"
> programs contains event coordinates).
>
> I've not yet been able to reproduce the bug myself.
>
> If possible, you could also send me access details to your DHIS 2
> instance, so I could have a closer look.
>
> Bjørn
>
> --
> Bjørn Sandvik
> GIS developer, DHIS 2
> University of Oslo
> www.dhis2.org
>
>
>
> On Tue, Feb 7, 2017 at 2:23 PM, Marc Garnica 
> wrote:
>
>> Code 500
>> Status: Internal Server Error
>>
>> Invalid format "01-02-2017" is malformed at "16"
>>
>> We are using DHIS2 2.26 build c086660
>>
>> Thank you very much!
>>
>> Marc
>>
>>
>> ___
>> 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
>>
>>
>
>
>
>


-- 
Bjørn Sandvik
GIS developer, DHIS 2
University of Oslo
www.dhis2.org
___
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


Re: [Dhis2-users] Accessing Admin password

2017-02-14 Thread Timothy Kiyemba
Thanks Knut,

It worked perfectly.

Timothy

On Tue, Feb 14, 2017 at 1:37 PM, Knut Staring  wrote:

> Try this:
>
> update users set password='$2a$10$wjLPViry3bkYEcjwGRqnYO1bT2Kl.ZY0kO.
> fwFDfMX53hitfx5.3C' where username='admin';
>
> Then restart tomcat to make sure the application cache is cleared.
>
> Then log in with admin/district.
>
> On Tue, Feb 14, 2017 at 11:30 AM, Timothy Kiyemba 
> wrote:
>
>> Dear all,
>>
>> Is there a way I can access my admin password? Probably in the postgress
>> database or any where else if I have forgotten it and cannot log into my
>> instance? Please support
>>
>> Timothy
>>
>> ___
>> 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
>>
>>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> Norway: +4791880522 <+47%20918%2080%20522>
> Skype: knutstar
> http://dhis2.org
>
___
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


Re: [Dhis2-users] [Dhis2-devs] My DHIS2 Reports app not loading

2017-02-14 Thread Timothy Kiyemba
Dear Jason,

I have cross checked and the user is the super user and is also assigned to
the parent organisation unit. However, the errors still persist as below
when I try to load events reports.

XML Parsing Error: no root element found
Location:
http://localhost:8080/misca/api/organisationUnits.json?userDataViewFallback=true=false=id,displayName|rename(name)&_dc=1487069562287
Line Number 1, Column 1:  organisationUnits.json:1:1
XML Parsing Error: no root element found
Location:
http://localhost:8080/misca/api/organisationUnitLevels.json?fields=id,displayName|rename(name),level=false&_dc=1487069562287
Line Number 1, Column 1:  organisationUnitLevels.json:1:1
XML Parsing Error: no root element found
Location:
http://localhost:8080/misca/api/legendSets.json?fields=id,displayName|rename(name),legends[id,displayName|rename(name),startValue,endValue,color]=false&_dc=1487069562288
Line Number 1, Column 1:  legendSets.json:1:1
XML Parsing Error: no root element found
Location:
http://localhost:8080/misca/api/dimensions.json?fields=id,displayName|rename(name)=dimensionType:eq:ORGANISATION_UNIT_GROUP_SET=false&_dc=1487069562289
Line Number 1, Column 1:  dimensions.json:1:1
XML Parsing Error: no root element found
Location:
http://localhost:8080/misca/api/organisationUnits.json?userOnly=true=id,displayName|rename(name),children[id,displayName|rename(name)]=false&_dc=1487069562288
Line Number 1, Column 1:

On Tue, Feb 14, 2017 at 11:50 AM, Jason Pickering <
jason.p.picker...@gmail.com> wrote:

> From the look of this error, it seems that you have not assigned this user
> to any organisation units?
>
> Regards,
> Jason
>
>
>
> XML Parsing Error: no root element found
> Location: http://localhost:8080/misca/api/legendSets.
> json?fields=id,displayName|rename(name),legends[id,
> displayName|rename(name),startValue,endValue,color]&
> paging=false&_dc=1486985622680
> Line Number 1, Column 1:  legendSets.json:1:1
> XML Parsing Error: no root element found
> Location: http://localhost:8080/misca/api/organisationUnitLevels.json?
> fields=id,displayName|rename(name),level=false&_dc=1486985622677
> Line Number 1, Column 1:  organisationUnitLevels.json:1:1
> XML Parsing Error: no root element found
> Location: http://localhost:8080/misca/api/organisationUnits.json?userDat
> aViewFallback=true=false=id,displayName|
> rename(name)&_dc=1486985622676
> Line Number 1, Column 1:  organisationUnits.json:1:1
> XML Parsing Error: no root element found
> Location: http://localhost:8080/misca/api/dimensions.
> json?fields=id,displayName|rename(name)=
> dimensionType:eq:ORGANISATION_UNIT_GROUP_SET=false&_
> dc=1486985622681
> Line Number 1, Column 1:  dimensions.json:1:1
>
> On Mon, Feb 13, 2017 at 2:48 PM, Calle Hedberg 
> wrote:
>
>> Timothy,
>>
>> If you are using the latest version of 2.26, then the more stringent
>> validation of URL characters in recent versions of Tomcat should be
>> supported (for details on the 8.5.x changes, see
>> http://tomcat.apache.org/tomcat-8.5-doc/changelog.html )
>>
>> If your logs still indicate that this is a tomcat issue, try upgrading to
>> tomcat 8.5.11 - if that don't work then downgrade to 8.0.36
>>
>> Regards
>> Calle
>>
>> On 13 February 2017 at 13:20, Jason Pickering <
>> jason.p.picker...@gmail.com> wrote:
>>
>>> The important thing to look for is a JavaScript error from the server,
>>> namely an HTTP 400 error code. Could you sent your JavaScript console when
>>> you load the app?
>>>
>>> On Mon, Feb 13, 2017 at 5:57 PM, Timothy Kiyemba 
>>> wrote:
>>>
 Dear Gerald,

 I have tried replacing the war file but the problem persists. See
 attached my catalina log file. I am working with Tomcat 8.5.8 and DHIS2
 2.26. Jason, do I still need to downgrade my Tomcat to 8.0.36? All my apps
 work except the Event reports app.

 Kind regards

 Timothy



 On Mon, Feb 13, 2017 at 9:48 AM, gerald thomas 
 wrote:

> Timothy,
> Please run maintenance and delete war file and name of folder which
> has the name of your war file. Download a new war and tail -f
> /path/Catalina.out if there is no error then everything should be fine.
> Kindly note I am saying "/path/" because I don't the path of your
> logs. Also tomcat must be stop before deleting war file and folder and
> "tail" the logs before starting tomcat.
> Wishing you the best.
>
> On Feb 13, 2017 06:26, "timothy kiyemba"  wrote:
>
>> Anybody with a solution to this problem?
>> --
>> From: Timothy Kiyemba 
>> Sent: ‎12/‎02/‎2017 21:59
>> To: dhis2-devs ; dhis2-users
>> 
>> Subject: My DHIS2 Reports app not loading
>>
>> Dear all
>>
>> Has any one faced this challenge before, my DHIS2 reports app is not

Re: [Dhis2-users] Accessing Admin password

2017-02-14 Thread Knut Staring
Try this:

update users set password='$2a$10$wjLPViry3bkYEcjwGRqnYO1bT2Kl.ZY0kO.
fwFDfMX53hitfx5.3C' where username='admin';

Then restart tomcat to make sure the application cache is cleared.

Then log in with admin/district.

On Tue, Feb 14, 2017 at 11:30 AM, Timothy Kiyemba 
wrote:

> Dear all,
>
> Is there a way I can access my admin password? Probably in the postgress
> database or any where else if I have forgotten it and cannot log into my
> instance? Please support
>
> Timothy
>
> ___
> 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
>
>


-- 
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522
Skype: knutstar
http://dhis2.org
___
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


[Dhis2-users] Accessing Admin password

2017-02-14 Thread Timothy Kiyemba
Dear all,

Is there a way I can access my admin password? Probably in the postgress
database or any where else if I have forgotten it and cannot log into my
instance? Please support

Timothy
___
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


[Dhis2-users] Output Raw Data in a matrix format -- DHIS2 2.24

2017-02-14 Thread Raminosoa Rabemanantsoa, Tantely
Dear Community,


With DHIS2 2.24, I am trying to output raw data in a matrix format. I have
used SQL View to output the data. Data values table is presented as
following:


*orgUnit UID,  dataElement1, Value, Period*

*orgUnit UID,  dataElement2, Value, Period*

*orgUnit UID,  dataElement3, Value, Period*

*orgUnit UID,  dataElement4, Value, Period*

*...*


I have used 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-02-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'));



I would like to output “raw data” for each orgUnit as following:



*orgUnit UID,  dataElement1, Value, dataElement2, Value, dataElement3,
Value, dataElement4,  Value, Period*

*...*



I have used pivot tables , but it is each time doing data agregation of the
dataElement.



How should I arrange the SQL code in order to have this result?



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


Re: [Dhis2-users] [Dhis2-devs] Output Raw Data in a matrix format -- DHIS2 2.24

2017-02-14 Thread Raminosoa Rabemanantsoa, Tantely
Dear Jason,

Thank you for this instruction. This is what I am looking for.

Kind Regards,

*Tantely Raminosoa*
*Data Officer*
Management Sciences for Health
Antananarivo Madagascar
Mobile: 0344280040
E-mail: tramino...@mikolo.org
Skype: traminosoa

Stronger health systems. Greater health impact.



www.msh.org

On Tue, Feb 14, 2017 at 11:42 AM, Jason Pickering <
jason.p.picker...@gmail.com> wrote:

> Hi Tantely,
>
> Well, you can use  a series of union statements to create a column for
> each of your data elements, but it might get unwieldy.
>
> You can  also use the "tablefunc" tools to generate such a cross tab. Its
> documented here
>
> https://www.postgresql.org/docs/9.5/static/tablefunc.html
>
> Regards,
> Jason
>
>
> On Tue, Feb 14, 2017 at 9:37 AM, Raminosoa Rabemanantsoa, Tantely <
> tramino...@mikolo.org> wrote:
>
>> Dear Community,
>>
>>
>> With DHIS2 2.24, I am trying to output raw data in a matrix format. I
>> have used SQL View to output the data. Data values table is presented as
>> following:
>>
>>
>> *orgUnit UID,  dataElement1, Value, Period*
>>
>> *orgUnit UID,  dataElement2, Value, Period*
>>
>> *orgUnit UID,  dataElement3, Value, Period*
>>
>> *orgUnit UID,  dataElement4, Value, Period*
>>
>> *...*
>>
>>
>> I have used 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-02-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'));
>>
>>
>>
>> I would like to output “raw data” for each orgUnit as following:
>>
>>
>>
>> *orgUnit UID,  dataElement1, Value, dataElement2, Value, dataElement3,
>> Value, dataElement4,  Value, Period*
>>
>> *...*
>>
>>
>>
>> I have used pivot tables , but it is each time doing data agregation of
>> the dataElement.
>>
>>
>>
>> How should I arrange the SQL code in order to have this result?
>>
>>
>>
>> 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-devs
>> Post to : dhis2-d...@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.picker...@gmail.com
> tel:+46764147049 <+46%2076%20414%2070%2049>
>

-- 
*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


Re: [Dhis2-users] [Dhis2-devs] My DHIS2 Reports app not loading

2017-02-14 Thread Jason Pickering
>From the look of this error, it seems that you have not assigned this user
to any organisation units?

Regards,
Jason



XML Parsing Error: no root element found
Location: http://localhost:8080/misca/api/legendSets.json?fields=id,
displayName|rename(name),legends[id,displayName|rename(
name),startValue,endValue,color]=false&_dc=1486985622680
Line Number 1, Column 1:  legendSets.json:1:1
XML Parsing Error: no root element found
Location: http://localhost:8080/misca/api/organisationUnitLevels.
json?fields=id,displayName|rename(name),level=false&_dc=1486985622677
Line Number 1, Column 1:  organisationUnitLevels.json:1:1
XML Parsing Error: no root element found
Location: http://localhost:8080/misca/api/organisationUnits.json?
userDataViewFallback=true=false=id,
displayName|rename(name)&_dc=1486985622676
Line Number 1, Column 1:  organisationUnits.json:1:1
XML Parsing Error: no root element found
Location: http://localhost:8080/misca/api/dimensions.json?fields=id,
displayName|rename(name)=dimensionType:eq:
ORGANISATION_UNIT_GROUP_SET=false&_dc=1486985622681
Line Number 1, Column 1:  dimensions.json:1:1

On Mon, Feb 13, 2017 at 2:48 PM, Calle Hedberg 
wrote:

> Timothy,
>
> If you are using the latest version of 2.26, then the more stringent
> validation of URL characters in recent versions of Tomcat should be
> supported (for details on the 8.5.x changes, see http://tomcat.apache.org/
> tomcat-8.5-doc/changelog.html )
>
> If your logs still indicate that this is a tomcat issue, try upgrading to
> tomcat 8.5.11 - if that don't work then downgrade to 8.0.36
>
> Regards
> Calle
>
> On 13 February 2017 at 13:20, Jason Pickering  > wrote:
>
>> The important thing to look for is a JavaScript error from the server,
>> namely an HTTP 400 error code. Could you sent your JavaScript console when
>> you load the app?
>>
>> On Mon, Feb 13, 2017 at 5:57 PM, Timothy Kiyemba 
>> wrote:
>>
>>> Dear Gerald,
>>>
>>> I have tried replacing the war file but the problem persists. See
>>> attached my catalina log file. I am working with Tomcat 8.5.8 and DHIS2
>>> 2.26. Jason, do I still need to downgrade my Tomcat to 8.0.36? All my apps
>>> work except the Event reports app.
>>>
>>> Kind regards
>>>
>>> Timothy
>>>
>>>
>>>
>>> On Mon, Feb 13, 2017 at 9:48 AM, gerald thomas 
>>> wrote:
>>>
 Timothy,
 Please run maintenance and delete war file and name of folder which has
 the name of your war file. Download a new war and tail -f
 /path/Catalina.out if there is no error then everything should be fine.
 Kindly note I am saying "/path/" because I don't the path of your logs.
 Also tomcat must be stop before deleting war file and folder and "tail" the
 logs before starting tomcat.
 Wishing you the best.

 On Feb 13, 2017 06:26, "timothy kiyemba"  wrote:

> Anybody with a solution to this problem?
> --
> From: Timothy Kiyemba 
> Sent: ‎12/‎02/‎2017 21:59
> To: dhis2-devs ; dhis2-users
> 
> Subject: My DHIS2 Reports app not loading
>
> Dear all
>
> Has any one faced this challenge before, my DHIS2 reports app is not
> loading. It just shows that its loading but it never completes. Could I
> have missed out a step somewhere? See image below;
>
> [image: Inline image 1]
>
> ___
> 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
>
>
>>>
>>> ___
>>> 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
>>>
>>>
>>
>>
>> --
>> Jason P. Pickering
>> email: jason.p.picker...@gmail.com
>> tel:+46764147049 <+46%2076%20414%2070%2049>
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-d...@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
>
> ***
>
> Calle Hedberg
>
> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
>
> Tel/fax (home): +27-21-685-6472 <+27%2021%20685%206472>
>
> Cell: +27-82-853-5352 <+27%2082%20853%205352>
>
> Iridium SatPhone: +8816-315-19119 <+881%206%20315%2019119>
>
> Email: calle.hedb...@gmail.com
>
> Skype: calle_hedberg
>
> ***
>
>


-- 
Jason P. Pickering
email: jason.p.picker...@gmail.com
tel:+46764147049

Re: [Dhis2-users] [Dhis2-devs] Output Raw Data in a matrix format -- DHIS2 2.24

2017-02-14 Thread Jason Pickering
Hi Tantely,

Well, you can use  a series of union statements to create a column for each
of your data elements, but it might get unwieldy.

You can  also use the "tablefunc" tools to generate such a cross tab. Its
documented here

https://www.postgresql.org/docs/9.5/static/tablefunc.html

Regards,
Jason


On Tue, Feb 14, 2017 at 9:37 AM, Raminosoa Rabemanantsoa, Tantely <
tramino...@mikolo.org> wrote:

> Dear Community,
>
>
> With DHIS2 2.24, I am trying to output raw data in a matrix format. I have
> used SQL View to output the data. Data values table is presented as
> following:
>
>
> *orgUnit UID,  dataElement1, Value, Period*
>
> *orgUnit UID,  dataElement2, Value, Period*
>
> *orgUnit UID,  dataElement3, Value, Period*
>
> *orgUnit UID,  dataElement4, Value, Period*
>
> *...*
>
>
> I have used 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-02-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'));
>
>
>
> I would like to output “raw data” for each orgUnit as following:
>
>
>
> *orgUnit UID,  dataElement1, Value, dataElement2, Value, dataElement3,
> Value, dataElement4,  Value, Period*
>
> *...*
>
>
>
> I have used pivot tables , but it is each time doing data agregation of
> the dataElement.
>
>
>
> How should I arrange the SQL code in order to have this result?
>
>
>
> 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-devs
> Post to : dhis2-d...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Jason P. Pickering
email: jason.p.picker...@gmail.com
tel:+46764147049
___
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