Calculating Median
Brett Greiner (Kinetix)
Brett@Kinetix.co.nz
Thu, 29 Jul 2004 09:12:15 +1200
This is a multi-part message in MIME format.
------_=_NextPart_001_01C474E7.8F0B6E98
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
That works if there is an uneven set of numbers.
If there are an even amount of numbers things are slightly different. In
that case you need to find the middle pair of numbers, add them together
and divide by two. =20
Brett=20
Kinetix Group Ltd.
New Zealand
-----Original Message-----
From: powerh-l-admin@lists.sowder.com
[mailto:powerh-l-admin@lists.sowder.com] On Behalf Of Robert Edis
Sent: Thursday, 29 July 2004 8:48 a.m.
To: PowerHouse List
Subject: RE: Calculating Median
=09
=09
Why do it in Quick? Then you have looping, designer files, and
temporary variables available for the logic. No subfile is required and
all processing can be done in designer procedures. =20
=20
Added bonus is that user can run screen and get median value any
time they choose without MIS getting involved.
=20
Blue
=09
David Morrison - Corporate <dmorrison@mcbrideelectric.com>
wrote:
Blair,
=09
How about something like this:
=09
Use a QTP program that does the following:
=09
1. First request: Sort the data on the value that you're
looking to get the median for. Output records to a sub-file at that
value, outputting the value and COUNT RESET. Put COUNT NORESET into a
global temporary item.=20
=09
2. Second request: Read the sub-file created in the
previous step (they're already sorted). Accumulate the total of the
counted field in each record. Compare that to the global temporary; when
it reaches 1/2 of that total, you have the median value.=20
=09
=09
David Morrison
McBride Electric
=09
-----Original Message-----
From: powerh-l-admin@lists.sowder.com
[mailto:powerh-l-admin@lists.sowder.com] On Behalf Of Blair Combs
Sent: Wednesday, July 28, 2004 12:23 PM
To: Powerhouse Listserv
Subject: Calculating Median
=09
Does anyone ha! ve an idea on how to calculate the
Median for a list of=20
numbers using Quiz?
=09
Blair Combs
Idaho State University
=09
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D
Mailing list: powerh-l@lists.sowder.com
Subscribe: "subscribe" in message body to
powerh-l-request@lists.sowder.com
Unsubscribe: "unsubscribe " in message body to
powerh-l-request@lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must
be a subscriber.
=09
=09
=09
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D
Mailing list: powerh-l@lists.sowder.com
Subscribe: "subscribe" in message body to
powerh-l-request@lists.sowder.com
Unsubscribe: "unsubscribe " in message body to
powerh-l-request@lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must
be a subscriber.
=09
------_=_NextPart_001_01C474E7.8F0B6E98
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV>
<P><SPAN class=3D594401021-28072004><FONT face=3DArial color=3D#0000ff =
size=3D2>That=20
works if there is an uneven set of numbers.</FONT></SPAN></P>
<P><FONT face=3DArial color=3D#0000ff size=3D2>If there are an even =
amount of numbers=20
things are slightly different. In that case <SPAN=20
class=3D189090921-28072004>you </SPAN>need to find the middle pair of =
numbers, add=20
them together and divide by two.</FONT> <SPAN=20
class=3D189090921-28072004><FONT face=3DArial color=3D#0000ff=20
size=3D2> </FONT></SPAN></P><SPAN class=3D189090921-28072004><FONT=20
color=3D#0000ff>
<DIV align=3Dleft><SPAN class=3D056582421-16032004><FONT =
face=3DArial><FONT=20
size=3D2><FONT color=3D#000080>Brett</FONT> </FONT></FONT>
<DIV><FONT face=3DArial color=3D#000080 size=3D2>Kinetix Group =
Ltd.</FONT></DIV>
<DIV><SPAN class=3D189090921-28072004><FONT face=3DArial color=3D#000080 =
size=3D2>New=20
Zealand</FONT></SPAN></DIV></SPAN></DIV></FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft><FONT=20
face=3DTahoma size=3D2>-----Original Message-----<BR><B>From:</B>=20
powerh-l-admin@lists.sowder.com =
[mailto:powerh-l-admin@lists.sowder.com] <B>On=20
Behalf Of </B>Robert Edis<BR><B>Sent:</B> Thursday, 29 July 2004 8:48=20
a.m.<BR><B>To:</B> PowerHouse List<BR><B>Subject:</B> RE: Calculating=20
Median<BR><BR></FONT></DIV>
<DIV>Why do it in Quick? Then you have looping, designer files, =
and=20
temporary variables available for the logic. No subfile is =
required and=20
all processing can be done in designer procedures. </DIV>
<DIV> </DIV>
<DIV>Added bonus is that user can run screen and get median value any =
time=20
they choose without MIS getting involved.</DIV>
<DIV> </DIV>
<DIV>Blue<BR><BR><B><I>David Morrison - Corporate=20
<dmorrison@mcbrideelectric.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=3Dreplbq=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px =
solid">Blair,<BR><BR>How=20
about something like this:<BR><BR>Use a QTP program that does the=20
following:<BR><BR>1. First request: Sort the data on the value that =
you're=20
looking to get the median for. Output records to a sub-file at that =
value,=20
outputting the value and COUNT RESET. Put COUNT NORESET into a =
global=20
temporary item. <BR><BR>2. Second request: Read the sub-file created =
in the=20
previous step (they're already sorted). Accumulate the total of the =
counted=20
field in each record. Compare that to the global temporary; when it =
reaches=20
1/2 of that total, you have the median value. <BR><BR><BR>David=20
Morrison<BR>McBride Electric<BR><BR>-----Original =
Message-----<BR>From:=20
powerh-l-admin@lists.sowder.com =
[mailto:powerh-l-admin@lists.sowder.com] On=20
Behalf Of Blair Combs<BR>Sent: Wednesday, July 28, 2004 12:23 =
PM<BR>To:=20
Powerhouse Listserv<BR>Subject: Calculating Median<BR><BR>Does =
anyone ha! ve=20
an idea on how to calculate the Median for a list of <BR>numbers =
using=20
Quiz?<BR><BR>Blair Combs<BR>Idaho State University<BR><BR>=3D =3D =
=3D =3D =3D =3D =3D =3D =3D=20
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D<BR>Mailing list:=20
powerh-l@lists.sowder.com<BR>Subscribe: "subscribe" in message body =
to=20
powerh-l-request@lists.sowder.com<BR>Unsubscribe: "unsubscribe =
<PASSWORD>"=20
in message body to=20
=
powerh-l-request@lists.sowder.com<BR>http://lists.sowder.com/mailman/list=
info/powerh-l<BR>This=20
list is closed, thus to post to the list you must be a=20
subscriber.<BR><BR><BR><BR>=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D=20
=3D =3D =3D<BR>Mailing list: powerh-l@lists.sowder.com<BR>Subscribe: =
"subscribe"=20
in message body to powerh-l-request@lists.sowder.com<BR>Unsubscribe: =
"unsubscribe <PASSWORD>" in message body to=20
=
powerh-l-request@lists.sowder.com<BR>http://lists.sowder.com/mailman/list=
info/powerh-l<BR>This=20
list is closed, thus to post to the list you must be a=20
subscriber.<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
=00
------_=_NextPart_001_01C474E7.8F0B6E98--