Calculating Median
Robert Edis
robeconsult@sbcglobal.net
Wed, 28 Jul 2004 13:47:48 -0700 (PDT)
--0-1836055100-1091047668=:424
Content-Type: text/plain; charset=us-ascii
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.
Added bonus is that user can run screen and get median value any time they choose without MIS getting involved.
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.
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.
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 have an idea on how to calculate the Median for a list of
numbers using Quiz?
Blair Combs
Idaho State University
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.
--0-1836055100-1091047668=:424
Content-Type: text/html; charset=us-ascii
<DIV>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. </DIV>
<DIV> </DIV>
<DIV>Added bonus is that user can run screen and get median value any time they choose without MIS getting involved.</DIV>
<DIV> </DIV>
<DIV>Blue<BR><BR><B><I>David Morrison - Corporate <dmorrison@mcbrideelectric.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Blair,<BR><BR>How about something like this:<BR><BR>Use a QTP program that does the following:<BR><BR>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. <BR><BR>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. <BR><BR><BR>David Morrison<BR>McBride Electric<BR><BR>-----Original Message-----<BR>From: powerh-l-admin@lists.sowder.com [mailto:powerh-l-admin@lists.sowder.com] On Behalf Of Blair Combs<BR>Sent: Wednesday, July 28, 2004 12:23 PM<BR>To: Powerhouse Listserv<BR>Subject: Calculating Median<BR><BR>Does anyone have an
idea on how to calculate the Median for a list of <BR>numbers using Quiz?<BR><BR>Blair Combs<BR>Idaho State University<BR><BR>= = = = = = = = = = = = = = = = = = = = = = = = = = = =<BR>Mailing list: powerh-l@lists.sowder.com<BR>Subscribe: "subscribe" in message body to powerh-l-request@lists.sowder.com<BR>Unsubscribe: "unsubscribe <PASSWORD>" in message body to powerh-l-request@lists.sowder.com<BR>http://lists.sowder.com/mailman/listinfo/powerh-l<BR>This list is closed, thus to post to the list you must be a subscriber.<BR><BR><BR><BR>= = = = = = = = = = = = = = = = = = = = = = = = = = = =<BR>Mailing list: powerh-l@lists.sowder.com<BR>Subscribe: "subscribe" in message body to powerh-l-request@lists.sowder.com<BR>Unsubscribe: "unsubscribe <PASSWORD>" in message body to powerh-l-request@lists.sowder.com<BR>http://lists.sowder.com/mailman/listinfo/powerh-l<BR>This list is closed, thus to post to the list you must be a subscriber.<BR></BLOCKQUOTE>
--0-1836055100-1091047668=:424--