Calculating Median

Deskin, Bob Bob.Deskin@Cognos.COM
Thu, 29 Jul 2004 07:25:34 -0400


This is a multi-part message in MIME format.

------_=_NextPart_001_01C4755E.C3CFDB33
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

And then there's the QUIZ solution. Let's say you want the median for =
item x. If the number of records is odd you want the value of x for =
record (n+1)/2. If the number of records is even, you want the average =
(sum divided by count) of the values of x for the two records n/2 and =
(n/2)+1.
=20
I can do this report in 4 passes (remember Name that Tune). Anyone for =
3?
=20
Disclaimer: I have not tested this other than in my head, and we all =
know what can happen when we only test in our heads :-)
=20
access file
sort on x
define x-count integer =3D 1
report summary x x-count subtotal
set subfile name xsub
go  ; this gives the values in sequence with a sequence number
=20
access *xsub
define n =3D 1
define x-1 =3D 1
sorted on x-1
report summary n subtotal
set subfile name xtotal at x-1  ; this is the same as AT FINAL which =
QUIZ doesn't have
go  ; this gives the total count n
=20
access xtotal
define x-med1 integer =3D (n + 1)/2 if 1 =3D mod(n,2) else n/2
define x-med2 integer =3D (n + 1)/2 if 1 =3D mod(n,2) else (n/2) + 1=20
define x-1 =3D 1
sorted on x-1
report summary x-med1 x-med2
set subfile name xmedian at x-1
go  ; this gives the record numbers of the one or two records you want
=20
set nosubfile
access *xsub link to record 0 of xmedian  ; record 1 on OpenVMS and =
OS/400
select if x-count =3D x-med1 or x-count =3D x-med2
; if x-med1 =3D x-med2 only one record will be selected
; if x-med1 <> x-med2 two records will be selected
report x average x-med1 x-med2
go  ; this gives the median
=20
Bob Deskin             =20
Senior Product Manager, Application Development Tools=20
Cognos Inc. 3755 Riverside Drive, Ottawa ON K1G 4K9 CANADA=20
bob.deskin@cognos.com (613) 738-1338 ext 7268=20

-----Original Message-----
From: powerh-l-admin@lists.sowder.com =
[mailto:powerh-l-admin@lists.sowder.com]On Behalf Of Robert Edis
Sent: July 28, 2004 7:11 PM
To: PowerHouse List
Subject: RE: Calculating Median


No, no, no ... I'm innocent I tell you!
=20
Ordinarily I would agree but in this particular case I suggest Quick =
because of simplicity.  Exception-to-the-rule and all that.
=20
Of couse I could of suggested using a 3GL tool - an external function if =
you like. :)
=20
Blue

David Morrison - Corporate <dmorrison@mcbrideelectric.com> wrote:

Blue,

=20

Ah, you're just trying to start trouble on the list-serve aren't you!  =
Didn't we just have a discussion about why not to use QUICK when QTP or =
QUIZ will do (and I was on the side of the QUICK solution)?

=20

Cordially,

=20

David Morrison

McBride Electric

=20

-----Original Message-----
From: powerh-l-admin@lists.sowder.com =
[mailto:powerh-l-admin@lists.sowder.com]On Behalf Of Robert Edis
Sent: Wednesday, July 28, 2004 1:48 PM
To: PowerHouse List
Subject: RE: Calculating Median

=20

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

David Morrison - Corporate <dmorrison@mcbrideelectric.com> wrote:

Blair,

How about something like this:

Use a QTP program that does the following:

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

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 tempor! ary; when it reaches 1/2 =
of that total, you have the median value.=20


David Morrison
McBride Electric

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

Does anyone ha! ve an idea on how to calculate the Median for a list of=20
numbers using Quiz?

Blair Combs
Idaho State University

=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.



=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.=20
 =20
       This message may contain privileged and/or confidential =
information.  If you have received this e-mail in error or are not the =
intended recipient, you may not use, copy, disseminate or distribute it; =
do not open any attachments, delete it immediately from your system and =
notify the sender promptly by e-mail that you have done so.  Thank you.=20
=20

------_=_NextPart_001_01C4755E.C3CFDB33
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML xmlns:eXclaimer=3D"http://www.exclaimer.co.uk">
<HEAD>
<META http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3DUTF-16">
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUTF-16">
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 5.50.4937.800" name=3DGENERATOR></HEAD><BODY =
><DIV>
<DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>And=20
then there's the QUIZ solution. Let's say you want&nbsp;<SPAN=20
class=3D937582411-29072004>the</SPAN> median for i<SPAN=20
class=3D937582411-29072004>tem</SPAN> x. If the number of records is odd =
you want=20
the value of x for record (n+1)/2. If the number of records is even, you =
want=20
the average (sum divided by count)&nbsp;of the values of x for the two =
records=20
n/2 and (n/2)+1.</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>I can=20
do this report in 4 passes (remember Name that Tune). Anyone for=20
3?</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2>Disclaimer: I have not tested this other than in my head, and =
we all know=20
what can happen when we only test in our heads :-)</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>access=20
file</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>sort=20
on x</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
x-count integer =3D 1</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>report=20
summary x x-count subtotal</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>set=20
subfile name xsub</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2>go&nbsp; ; this gives the values in sequence with&nbsp;a =
sequence=20
number</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>access=20
*xsub</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
n =3D 1</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
x-1 =3D 1</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>sorted=20
on x-1</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>report=20
summary n subtotal</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>set=20
subfile name xtotal at x-1&nbsp; ; this is the same as AT FINAL which =
QUIZ=20
doesn't have</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2>go&nbsp; ; this gives the total count n</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>access=20
xtotal</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
x-med1 integer&nbsp;=3D (n + 1)/2 if 1 =3D mod(n,2) else =
n/2</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>define=20
x-med2 integer =3D (n + 1)/2 if 1 =3D mod(n,2) else (n/2) +=20
1&nbsp;</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004></SPAN><SPAN =
class=3D971043800-29072004><FONT=20
face=3DArial color=3D#0000ff size=3D2>define x-1 =3D =
1</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>sorted=20
on x-1</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>report=20
summary x-med1 x-med2</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>set=20
subfile name xmedian at x-1</FONT></SPAN></DIV><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>go&nbsp; ; this gives the record numbers of the one or two =
records you=20
want</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>set=20
nosubfile</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>access=20
*xsub link to record 0 of xmedian&nbsp; ; record 1 on OpenVMS and=20
OS/400</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>select=20
if x-count =3D x-med1 or x-count =3D x-med2</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>; if=20
x-med1 =3D x-med2 only one record will be selected</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>; if=20
x-med1 &lt;&gt; x-med2 two records will be selected</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =
size=3D2>report=20
x average x-med1 x-med2</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2>go&nbsp; ; this gives the median</FONT></SPAN></DIV>
<DIV><SPAN class=3D971043800-29072004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D971043800-29072004>
<P><FONT face=3DArial><FONT color=3D#0000ff size=3D2>Bob=20
Deskin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
<BR>Senior Product Manager, Application Development Tools <BR>Cognos =
Inc. 3755=20
Riverside Drive, Ottawa ON K1G 4K9 CANADA <BR>bob.deskin@cognos.com =
(613)=20
738-1338 ext 7268 </FONT></FONT></SPAN></P></DIV></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  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> July 28, 2004 7:11 =
PM<BR><B>To:</B>=20
  PowerHouse List<BR><B>Subject:</B> RE: Calculating =
Median<BR><BR></FONT></DIV>
  <DIV>No, no, no ... I'm innocent I tell you!</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Ordinarily I would agree but in this particular case I suggest =
Quick=20
  because of simplicity.&nbsp; Exception-to-the-rule and all that.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Of couse I could of suggested using a 3GL tool - an external =
function if=20
  you like. :)</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Blue<BR><BR><B><I>David Morrison - Corporate=20
  &lt;dmorrison@mcbrideelectric.com&gt;</I></B> wrote:</DIV>
  <BLOCKQUOTE class=3Dreplbq=20
  style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px =
solid">
    <META content=3DWord.Document name=3DProgId>
    <META content=3D"Microsoft Word 9" name=3DGenerator>
    <META content=3D"Microsoft Word 9" name=3DOriginator><LINK=20
    href=3D"cid:filelist.xml@01C474B6.5AE0D350" rel=3DFile-List>
    <STYLE>@font-face {
	font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; =
mso-header-margin: .5in; mso-footer-margin: .5in; mso-paper-source: 0; }
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
P.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
SPAN.EmailStyle15 {
	COLOR: navy; mso-style-type: personal-reply; mso-ansi-font-size: =
10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; =
mso-bidi-font-family: Arial
}
DIV.Section1 {
	page: Section1
}
</STYLE>

    <DIV class=3DSection1>
    <P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3DArial =
color=3Dnavy=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: =
12.0pt">Blue,<o:p></o:p></SPAN></FONT></SPAN></P>
    <P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3DArial =
color=3Dnavy=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: =
12.0pt">&nbsp;<o:p></o:p></SPAN></FONT></SPAN></P>
    <P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3DArial =
color=3Dnavy=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: =
12.0pt">Ah,=20
    you&#8217;re just trying to start trouble on the list-serve =
aren&#8217;t you!<SPAN=20
    style=3D"mso-spacerun: yes">&nbsp; </SPAN>Didn&#8217;t we just have =
a discussion=20
    about why not to use QUICK when QTP or QUIZ will do (and I was on =
the side=20
    of the QUICK solution)?<o:p></o:p></SPAN></FONT></SPAN></P>
    <P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3DArial =
color=3Dnavy=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: =
12.0pt">&nbsp;<o:p></o:p></SPAN></FONT></SPAN></P>
    <P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3DArial =
color=3Dnavy=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: =
12.0pt">Cordially,<o:p></o:p></SPAN></FONT></SPAN></P>
    <P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3DArial =
color=3Dnavy=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: =
12.0pt">&nbsp;<o:p></o:p></SPAN></FONT></SPAN></P>
    <P class=3DMsoAutoSig><FONT color=3Dnavy><SPAN style=3D"COLOR: =
navy">David=20
    Morrison</SPAN></FONT><FONT color=3Dnavy><SPAN=20
    style=3D"COLOR: navy; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
    <P class=3DMsoAutoSig><FONT face=3D"Times New Roman" color=3Dnavy =
size=3D3><SPAN=20
    style=3D"FONT-SIZE: 12pt; COLOR: navy">McBride =
Electric</SPAN></FONT><FONT=20
    color=3Dnavy><SPAN=20
    style=3D"COLOR: navy; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
    <P class=3DMsoNormal><SPAN class=3DEmailStyle15><FONT face=3DArial =
color=3Dnavy=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: =
12.0pt">&nbsp;<o:p></o:p></SPAN></FONT></SPAN></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3DTahoma color=3Dblack=20
    size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: =
Tahoma">-----Original=20
    Message-----<BR><B><SPAN style=3D"FONT-WEIGHT: =
bold">From:</SPAN></B>=20
    powerh-l-admin@lists.sowder.com=20
    [mailto:powerh-l-admin@lists.sowder.com]<B><SPAN=20
    style=3D"FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Robert =
Edis<BR><B><SPAN=20
    style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, July 28, =
2004 1:48=20
    PM<BR><B><SPAN style=3D"FONT-WEIGHT: bold">To:</SPAN></B> PowerHouse =

    List<BR><B><SPAN style=3D"FONT-WEIGHT: bold">Subject:</SPAN></B> RE: =

    Calculating Median</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: =
12pt">&nbsp;<o:p></o:p></SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    color=3Dblack size=3D3><SPAN style=3D"FONT-SIZE: 12pt; COLOR: =
black">Why do it in=20
    Quick?&nbsp; Then you have looping, designer files, and temporary =
variables=20
    available for the logic.&nbsp; No subfile is required and all =
processing can=20
    be done in designer procedures.&nbsp; </SPAN></FONT><FONT =
color=3Dblack><SPAN=20
    style=3D"COLOR: black; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    color=3Dblack size=3D3><SPAN=20
    style=3D"FONT-SIZE: 12pt; COLOR: black">&nbsp;</SPAN></FONT><FONT=20
    color=3Dblack><SPAN=20
    style=3D"COLOR: black; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    color=3Dblack size=3D3><SPAN style=3D"FONT-SIZE: 12pt; COLOR: =
black">Added bonus=20
    is that user can run screen and get median value any time they =
choose=20
    without MIS getting involved.</SPAN></FONT><FONT color=3Dblack><SPAN =

    style=3D"COLOR: black; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    color=3Dblack size=3D3><SPAN=20
    style=3D"FONT-SIZE: 12pt; COLOR: black">&nbsp;</SPAN></FONT><FONT=20
    color=3Dblack><SPAN=20
    style=3D"COLOR: black; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    color=3Dblack size=3D3><SPAN=20
    style=3D"FONT-SIZE: 12pt; COLOR: black">Blue<BR><BR><B><I><SPAN=20
    style=3D"FONT-WEIGHT: bold; FONT-STYLE: italic">David Morrison - =
Corporate=20
    &lt;dmorrison@mcbrideelectric.com&gt;</SPAN></I></B>=20
    wrote:</SPAN></FONT><FONT color=3Dblack><SPAN=20
    style=3D"COLOR: black; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P>
    <DIV=20
    style=3D"BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: =
medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: =
#1010ff 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
    <P class=3DMsoNormal=20
    style=3D"BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: =
medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN-LEFT: =
39.75pt; BORDER-LEFT: medium none; MARGIN-RIGHT: 0.5in; PADDING-TOP: =
0in; BORDER-BOTTOM: medium none; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto; mso-border-left-alt: solid #1010FF 1.5pt; =
mso-padding-alt: 0in 0in 0in 4.0pt"><FONT=20
    face=3D"Times New Roman" color=3Dblack size=3D3><SPAN=20
    style=3D"FONT-SIZE: 12pt; COLOR: black">Blair,<BR><BR>How about =
something like=20
    this:<BR><BR>Use a QTP program that does the following:<BR><BR>1. =
First=20
    request: Sort the data on the value that you're looking to get the =
median=20
    for. Output records to a sub-file at that value, outputting the =
value and=20
    COUNT RESET. Put COUNT NORESET into a global temporary item. =
<BR><BR>2.=20
    Second request: Read the sub-file created in the previous step =
(they're=20
    already sorted). Accumulate the total of the counted field in each =
record.=20
    Compare that to the global tempor! ary; when it reaches 1/2 of that =
total,=20
    you have the median value. <BR><BR><BR>David Morrison<BR>McBride=20
    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.</SPAN></FONT><FONT color=3Dblack><SPAN=20
    style=3D"COLOR: black; mso-color-alt: =
windowtext"><o:p></o:p></SPAN></FONT></P></DIV></DIV></BLOCKQUOTE></BLOCK=
QUOTE></DIV>
<DIV>&nbsp;</DIV>
<DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT FACE=3D"Arial" =
SIZE=3D"2">This message may contain privileged and/or confidential =
information.&nbsp; If you have received this e-mail in error or are not =
the intended recipient, you may not use, copy, disseminate or distribute =
it; do not open any attachments, delete it immediately from your system =
and notify the sender promptly by e-mail that you have done so.&nbsp; =
Thank you.</FONT>
</P>
</DIV></BODY></HTML>

------_=_NextPart_001_01C4755E.C3CFDB33--