Aggregation Query Builder doesn't count

Hello Friends.

After migrate to 2.12 version, the aggregation query builder doesn't aggrega=
te the values in the data element. We test with new data elements, simple q=
ueries but doesn't work. Maybe the new version has other parameters to agg=
regate the values?.

Thank you very much.


Ing. Marko David Garcia M.
=C3=81rea de Sistemas integrados de Informaci=C3=B3n
Secretar=C3=ADa de Salud Departamental del Cauca

_______________________________________________ Mailing list: https://launch= Post to : Unsubscribe := More help :

_______________________________________________ Mailing list: https://launch= Post to : Unsubscribe := More help :


Mailing list:
Post to :
Unsubscribe :
More help :

_______________________________________________ Mailing list: https://launch= Post to : Unsubscribe := More help :

Content-Type: text/html;
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div style=3D"-webkit-text-size-adjust: aut=
o; ">Hi Helder,</div><div style=3D"-webkit-text-size-adjust: auto; "><br></d=

<div style=3D"-webkit-text-size-adjust: auto; ">This bug was fixed for on=

ly 1.12 version. For 2.13, we have a plan to improve it by using web-API. An=
d I am working on it.</div><div style=3D"-webkit-text-size-adjust: auto; "><=

</div><div><span style=3D"-webkit-text-size-adjust: auto;">I tested this b=

ug on demo server ( with revision&nbsp;</span><span style=3D"-webkit-text-si=
ze-adjust: auto; background-color: rgba(255, 255, 255, 0);">11292 &nbsp;in t=
his morning), it works fine. Can you help me to test it again ?</span></div>=
<div style=3D"-webkit-text-size-adjust: auto; "><font face=3D"LiberationSans=
Regular, arial, sans-serif"><span style=3D"line-height: 25px; -webkit-tap-hi=
ghlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: r=
gba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128,=
180, 0.230469);"><br></span></font><br>Best regard,</div><div style=3D"-web=
kit-text-size-adjust: auto; "><br>On 30-08-2013, at 23:42, helder yesid cast=
rillon cobo &lt;<a href=3D"">helder_947@hotmail=
.com</a>&gt; wrote:<br><br></div><div style=3D"-webkit-text-size-adjust: aut=
o; ">

.hmmessage P
font-size: 12pt;
<div dir=3D"ltr">Hi,<br>I downloaded DHIS 2.13-SNAPSHOT with revision 11846 f=
rom <a href=3D"" target=3D"_blank=
"></a>&nbsp; to test, but&nbsp; i=
n this revision the error persist, also we tested in the demo of DHIS to dis=
card errors in ours Data, obtaining the same error.<br><br><br><br><br>Mg. H=
elder Yesid Castrillon.<br>

Sistemas de informaci=C3=B3n<br>Secretar=C3=ADa departamental de salud del c=
auca.<br><br><br><div><hr id=3D"stopSpelling">From: <a href=3D"mailto:helder="></a><br>To: <a href=3D"mailto:tran.h="></a><br>Date: Fri, 30 Aug 20=
13 15:17:29 +0200<br>CC: <a href=3D"">=</a><br>Subject: Re: [Dhis2-users] Aggregatio=
n Query Builder doesn't count<br><br>

.ExternalClass .ecxhmmessage P {

.ExternalClass body.ecxhmmessage {

<div dir=3D"ltr">Ok, I tested with revisions 11245 and 11290&nbsp; but the e=
rror persist, today I downloaded Dhis the web site (<a href=3D"http://www.dh="></a>), however it is the sa=
me revision (11290)<br>How I download DHIS 2.12 with revision 11291?.<br><br=

Mg. Helder Yesid Castrillon.<br>

Sistemas de informaci=C3=B3n<br>Secretar=C3=ADa departamental de salud del c=
auca.<br><br><br><div><hr id=3D"ecxstopSpelling">From: <a href=3D"mailto:tra="></a><br>Date: Fri, 30 Aug=
2013 10:48:17 +0700<br>Subject: Re: [Dhis2-users] Aggregation Query Builder=
doesn't count<br>To: <a href=3D"">helder_947@h=</a><br>CC: <a href=3D"">markodavidgm=</a>; <a href=3D"">dhis2-use=</a><br><br><div dir=3D"ltr">Hi Helder,<div><br></div>=
<div>It's fixed for 2.12 with revision&nbsp;11291. Please help me to re-test=
it on your side. Thank you.</div></div><div class=3D"ecxgmail_extra"><br cl=
ear=3D"all"><div>Best regards,<br>------------------------------------------=

Ch=C3=A2u Thu Tr=C3=A2n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>HISP Viet Nam=
<br>Email: <a href=3D"" target=3D"_blank">t=</a></div>
<br><br><div class=3D"ecxgmail_quote">On Fri, Aug 30, 2013 at 3:49 AM, helde=
r yesid castrillon cobo <span dir=3D"ltr">&lt;<a href=3D"mailto:helder_947@h=" target=3D"_blank"></a>&gt;</span> wrote:<b=

<blockquote class=3D"ecxgmail_quote" style=3D"border-left:1px #ccc solid;p=


<div><div dir=3D"ltr">It is not our case, all the formulas has apostroph (')=
in the values. We have identified that the bug is when we do aggregation qu=
ery using the patients attributes created by us.<br><br><br><br>Mg. Helder Y=
esid Castrillon.<br>

Sistemas de informaci=C3=B3n<br>Secretar=C3=ADa departamental de salud del c=
auca.<br><br><br><br><div><hr>From: <a href=3D"mailto:tran.hispvietnam@gmail=
.com" target=3D"_blank"></a><br>Date: Wed, 28 Aug 2=
013 15:39:52 +0700<div class=3D"ecxim">

<br>Subject: Re: [Dhis2-users] Aggregation Query Builder doesn't count<br></=

To: <a href=3D"" target=3D"_blank">markodav=</a><br>CC: <a href=3D"" target=3D=
"_blank"></a>; <a href=3D"mailto:dhis2-users@lists.lau=" target=3D"_blank"></a><div>

<div class=3D"h5"><br><br><div dir=3D"ltr">Hi Marko,<br><br>It works with fo=
rmula [CA:43567] =3D 'Gender'. For formulas like this [CA:43567] =3D Gender (=
Gender didn't put between apostroph ), formulas didn't work. So if you have a=
ny formula similar to the second case, please put value to compare between a=
postroph (') . This bug will be fixed for 2.13 version as plan.<br>

<br>Thank you, Marko.<br></div><div><br clear=3D"all"><div>Best regards,<br>=
------------------------------------------------<br>Ch=C3=A2u Thu Tr=C3=A2n&=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>HISP Viet Nam<br>Email: <a href=3D"mai=" target=3D"_blank">

<br><br><div>On Tue, Aug 27, 2013 at 9:15 PM, Marko David Garcia Mu=C3=B1oz <=
span dir=3D"ltr">&lt;<a href=3D"" target=3D"_bl=
ank"></a>&gt;</span> wrote:<br><blockquote style=3D"bo=
rder-left:1px #ccc solid;padding-left:1ex;">

<div style=3D"word-wrap:break-word;">Thank you Tran.<div><br></div><div>"Reg=
imen" is patient attribute created by Us, when we try to test the condition t=
he system show the warning window.</div><div>For Example if we use "Genero" =3D=
Gender, or if we use the dataelement parameter ('210 - Dengue') the query w=
orks fine.</div>

<div><br></div><div>Thank you very much.<br><div><br></div><div>&lt;Captura d=
e pantalla 2013-08-27 a la(s) 8.52.00.png&gt;<br><div>
<div style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;text=

<div style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;text=

Cordialmente,<br><br>Ing. Marko David Garcia Mu=C3=B1oz</div><div style=3D"t=

Secretar=C3=ADa Departamental de Salud del Cauca</div><div style=3D"text-ind=

=C3=81rea de Sistemas Integrados de Informaci=C3=B3n</div><div style=3D"text=

Skype: marko_david<br><br><br></div></div>
<br><div><div>El 26/08/2013, a las 23:19, Tran Chau &lt;<a href=3D"mailto:tr=" target=3D"_blank"></a>&g=
t; escribi=C3=B3:</div><div><div><br><blockquote><div dir=3D"ltr">

Dear Marko and&nbsp;Helder,<br><div><br></div><div>Could you please send to m=
e the formula you created. I can try to test with this formula in my laptop.=
</div><div><br></div><div>Thank you.</div></div><div>

<br clear=3D"all"><div>Best regards,<br>------------------------------------=
------------<br>Ch=C3=A2u Thu Tr=C3=A2n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <=

HISP Viet Nam<br>Email: <a href=3D"" tar=


<br><br><div>On Tue, Aug 27, 2013 at 5:47 AM, helder yesid castrillon cobo <=
span dir=3D"ltr">&lt;<a href=3D"" target=3D"_bl=
ank"></a>&gt;</span> wrote:<br><blockquote style=3D"bo=
rder-left:1px #ccc solid;padding-left:1ex;">

<div><div dir=3D"ltr">sorry!!<br><br>SEX =3D gender<br>In spanish genero, se=
xo.<br><br>ING. Helder Yesid Castrillon.<br><div><br><br><br></div><div><div=

<hr>From: <a href=3D"" target=3D"_blank">helde=</a><br>

To: <a href=3D"" target=3D"_blank">markodavidgm=</a>; <a href=3D"" target=3D=
"_blank"></a><br>Date: Tue, 27 Aug 2013 00:43=
:56 +0200<br>

Subject: Re: [Dhis2-users] Aggregation Query Builder doesn't count</div><div=


<div dir=3D"ltr">Hi, We have reviewed in detail and we found that the proble=
m is presented with aggregation query that use the attribute of patient that=
we have created. <br>The postgres console print the next error.<br>&nbsp;<b=

<b>ERROR: syntax error at or near ")" at character 617<br>STATEMENT: SELECT '=
0' as dataelementid, '0' as categoryoptioncomboid, ou.organisationunitid as s=
ourceid, '0' as periodid,'DHIS-SYSTEM' as comment, '201308' as periodIsoDate=
,'dataelementname' as dataelementname, 'optioncomboid' as categoryoptioncomb=
oname, <a href=3D"" target=3D"_blank"></a> as organisa=
tionunitname, count (psi.programinstanceid ) as value FROM programstageinsta=
nce as psi INNER JOIN organisationunit ou on
anisationunitid WHERE EXISTS ( SELECT * FROM patientattributevalue _pav WHER=
E _pav.patientid =3D pi.patientid and _pav.patientattributeid=3D280 AND p.or=
ganisationunitid in (0) AND _pav.value )=3D'Especial' ) GROUP BY ou.organisa=
tionunitid, <a href=3D"" target=3D"_blank"></a></b><br=

<br>the error is generated when we edit the aggregation query, but it is don=
't generated with aggregation query that use the attibutes of patient that i=
t is by default. (Sex).<br><br>Thanks, <br><br>ING. Helder Yesid Castrillon.=

Secretar=C3=ADa departamental de salud<br><br><br><div><hr>Date: Mon, 26 Aug=
2013 09:21:39 -0500<br>From: <a href=3D"" targ=
et=3D"_blank"></a><br>To: <a href=3D"mailto:dhis2-user=" target=3D"_blank"></a>=

Subject: [Dhis2-users] Aggregation Query Builder doesn't count<br><br><div d=
ir=3D"ltr">Hello Friends.<div><br></div><div>After migrate to 2.12 version, t=
he aggregation query builder doesn't aggregate the values in the data elemen=
t. &nbsp;We test with new data elements, simple queries but doesn't work. &n=
bsp; Maybe the new version has other parameters to aggregate the values?.</d=

<div><br></div><div>Thank you very much.</div><div>&nbsp;<br clear=3D"all"><=

<br></div>-- <br>Regards,<div><br><br><font face=3D"arial, helvetica, sa=

ns-serif"><b><font color=3D"#336666">Ing. Marko David Garcia M.<br></font></=


<font face=3D"arial, helvetica, sans-serif"><b><font color=3D"#336666">=C3=81=
rea de Sistemas integrados de Informaci=C3=B3n<br>Secretar=C3=ADa de Salud D=
epartamental del Cauca<br><font color=3D"#3333ff"><br></font></font></b></fo=


Mailing list: <a href=3D"" target=3D"_blan=
Post to : <a href=3D"" target=3D"_=
Unsubscribe : <a href=3D"" target=3D"_blan=
More help : <a href=3D"" target=3D"_bla=
nk"></a></div> =
Mailing list: <a href=3D"" target=3D"_blan=
Post to : <a href=3D"" target=3D"_=
Unsubscribe : <a href=3D"" target=3D"_blan=
More help : <a href=3D"" target=3D"_bla=
nk"></a></div></div></div> =
Mailing list: <a href=3D"" target=3D"_blan=
Post to &nbsp; &nbsp; : <a href=3D"" t=
Unsubscribe : <a href=3D"" target=3D"_blan=
More help &nbsp; : <a href=3D"" target=3D=
</div></div></div></div> </div></d=

</blockquote></div><br></div></div> <=
Mailing list: <a href=3D"">https://launchp=</a>
Post to : <a href=3D"">dhis2-users=</a>
Unsubscribe : <a href=3D"">https://launchp=</a>
More help : <a href=3D"">https://help.l=</a></div> <=