Days per period

What I hear you saying is that we can get this in a report table but not in=
an indicator calculation or validation expression.

Also, my recollection is that custom SQL view only allows select statements=
, so we can't use it to update a hidden data element, right?=A0 And we coul=
d muck with the Hibernate definition to get a virtual column in the period =
table but we'd have no way to use it.

···

-----Original Message-----
From: Jason Pickering [mailto:jason.p.pickering@gmail.com]=20
Sent: Wednesday, May 11, 2011 5:01 AM
To: Friedman, Roger (CDC/CGH/DGHA) (CTR)
Cc: dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-users] Days per period

It would be available through a pretty trivial SQL statement if you
are calculating this on an external report.

SELECT periodid, enddate-startdate as nbr_days FROM period in
Postgresql will give you the number of days in a given period along
with the periodid. you could then join this to the aggregated data
elements you mention with periodid and the aggregateddatavalue table.

I think the easiest way would be through a custom SQL view (which is
now supported) or through a report rather than direct calculation
through the system.

Regards,
Jason

On Wed, May 11, 2011 at 10:56 AM, Friedman, Roger (CDC/CGH/DGHA) (CTR) <rdf4@cdc.gov> wrote:

Listers --
=A0 =A0We need to calculate bed occupancy rates. =A0We have the number of
beds per ward and the number of person-days of bed use per month, but we
need the number of days per month. =A0Is that available in some way from
the system or are we going to have to key it?
Thanks, Roger

_______________________________________________
Mailing list: DHIS 2 Users in Launchpad
Post to =A0 =A0 : dhis2-users@lists.launchpad.net
Unsubscribe : DHIS 2 Users in Launchpad
More help =A0 : ListHelp - Launchpad Help

--=20
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

_______________________________________________
Mailing list: DHIS 2 Users in Launchpad
Post to=A0 =A0=A0=A0: dhis2-users@lists.launchpad.net
Unsubscribe : DHIS 2 Users in Launchpad
More help=A0=A0=A0: ListHelp - Launchpad Help

--0-56937025-1305106829=:57354
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;"><br><br><div><font color=3D"#0000bf">PEPELA W=
ANJALA</font></div><div><font color=3D"#6000bf"><strong>MINISTRY OF HEALTH =
HEADQUARTERS</strong></font></div><div><strong><font color=3D"#6000bf">HEAL=
TH&nbsp;INFORMATION SYSTEM</font></strong></div><div><strong>AFYA HOUSE, HI=
S LG 37</strong></div><div><strong>P.O BOX 30016, NAIROBI, KENYA</strong></=

<div><strong>TEL: +254 (020) 2717077 EXT 45097</strong></div><div><stro=
CELL: +254 (0) 722375633 or 0202033363</strong></div><div><strong>EMAIL:=

<font color=3D"#0000bf"><a rel=3D"nofollow" target=3D"_blank" href=3D"mail=
to:wanjala2p@yahoo.com">wanjala2p@yahoo.com</a></font></strong></div><div><=

<font color=3D"#0000bf">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=

bsp;&nbsp;&nbsp;&nbsp; <a rel=3D"nofollow" target=3D"_blank" href=3D"mailto=
:hmis@health.go.ke">hmis@health.go.ke</a></font></strong></div><div>&nbsp;<=
/div><br><br>--- On
<b>Wed, 5/11/11, Friedman, Roger (CDC/CGH/DGHA) (CTR) <i>&lt;rdf4@cdc.gov&=
gt;</i></b> wrote:<br><blockquote style=3D"border-left: 2px solid rgb(16, 1=
6, 255); margin-left: 5px; padding-left: 5px;"><br>From: Friedman, Roger (C=
DC/CGH/DGHA) (CTR) &lt;rdf4@cdc.gov&gt;<br>Subject: Re: [Dhis2-users] Days =
per period<br>To: "Jason Pickering" &lt;jason.p.pickering@gmail.com&gt;<br>=
Cc: dhis2-users@lists.launchpad.net<br>Date: Wednesday, May 11, 2011, 2:19 =
AM<br><br><div class=3D"plainMail">What I hear you saying is that we can ge=
t this in a report table but not in an indicator calculation or validation =
expression.<br><br>Also, my recollection is that custom SQL view only allow=
s select statements, so we can't use it to update a hidden data element, ri=
ght?&nbsp; And we could muck with the Hibernate definition to get a virtual=
column in the period table but we'd have no way to use it.<br><br>-----Ori=
ginal Message-----<br>From: Jason Pickering [mailto:<a
ymailto=3D"mailto:jason.p.pickering@gmail.com" href=3D"/mc/compose?to=3Dja=
son.p.pickering@gmail.com">jason.p.pickering@gmail.com</a>] <br>Sent: Wedne=
sday, May 11, 2011 5:01 AM<br>To: Friedman, Roger (CDC/CGH/DGHA) (CTR)<br>C=
c: <a ymailto=3D"mailto:dhis2-users@lists.launchpad.net" href=3D"/mc/compos=
e?to=3Ddhis2-users@lists.launchpad.net">dhis2-users@lists.launchpad.net</a>=
<br>Subject: Re: [Dhis2-users] Days per period<br><br>It would be available=
through a pretty trivial SQL statement if you<br>are calculating this on a=
n external report.<br><br>SELECT periodid, enddate-startdate as nbr_days FR=
OM period in<br>Postgresql will give you the number of days in a given peri=
od along<br>with the periodid. you could then join this to the aggregated d=
ata<br>elements you mention with periodid and the aggregateddatavalue table=
.<br><br> I think the easiest way would be through a custom SQL view (which=
is<br>now supported) or through a report rather than direct
calculation<br>through the system.<br><br>Regards,<br>Jason<br><br><br><br=

On Wed, May 11, 2011 at 10:56 AM, Friedman, Roger (CDC/CGH/DGHA) (CTR)<br>=

&lt;<a ymailto=3D"mailto:rdf4@cdc.gov" href=3D"/mc/compose?to=3Drdf4@cdc.go=
v">rdf4@cdc.gov</a>&gt; wrote:<br>&gt; Listers --<br>&gt; &nbsp; &nbsp;We n=
eed to calculate bed occupancy rates. &nbsp;We have the number of<br>&gt; b=
eds per ward and the number of person-days of bed use per month, but we<br>=
&gt; need the number of days per month. &nbsp;Is that available in some way=
from<br>&gt; the system or are we going to have to key it?<br>&gt; Thanks,=
Roger<br>&gt;<br>&gt; _______________________________________________<br>&=
gt; Mailing list: <a href=3D"https://launchpad.net/~dhis2-users&quot; target=3D"=
_blank">https://launchpad.net/~dhis2-users&lt;/a&gt;&lt;br&gt;&amp;gt; Post to &nbsp; &nbsp=
; : <a ymailto=3D"mailto:dhis2-users@lists.launchpad.net" href=3D"/mc/compo=
se?to=3Ddhis2-users@lists.launchpad.net">dhis2-users@lists.launchpad.net</a=

<br>&gt;

Unsubscribe : <a href=3D"https://launchpad.net/~dhis2-users&quot; target=3D"_bl=
ank">https://launchpad.net/~dhis2-users&lt;/a&gt;&lt;br&gt;&amp;gt; More help &nbsp; : <a h=
ref=3D"https://help.launchpad.net/ListHelp&quot; target=3D"_blank">https://help.=
launchpad.net/ListHelp</a><br>&gt;<br><br><br><br>-- <br>Jason P. Pickering=
<br>email: <a ymailto=3D"mailto:jason.p.pickering@gmail.com" href=3D"/mc/co=
mpose?to=3Djason.p.pickering@gmail.com">jason.p.pickering@gmail.com</a><br>=
tel:+260974901293<br><br><br>______________________________________________=
_<br>Mailing list: <a href=3D"https://launchpad.net/~dhis2-users&quot; target=3D=
"_blank">https://launchpad.net/~dhis2-users&lt;/a&gt;&lt;br&gt;Post to&nbsp; &nbsp;&nbs=
p;&nbsp;: <a ymailto=3D"mailto:dhis2-users@lists.launchpad.net" href=3D"/mc=
/compose?to=3Ddhis2-users@lists.launchpad.net">dhis2-users@lists.launchpad.=
net</a><br>Unsubscribe : <a href=3D"https://launchpad.net/~dhis2-users&quot; tar=
get=3D"_blank">https://launchpad.net/~dhis2-users&lt;/a&gt;&lt;br&gt;More help&nbsp;&nb=
sp;&nbsp;: <a
href=3D"https://help.launchpad.net/ListHelp&quot; target=3D"_blank">https://hel=
p.launchpad.net/ListHelp</a><br></div></blockquote></td></tr></table>
--0-56937025-1305106829=:57354--