Chuck,

If you're pulling the data from a database you you could use the 'summary of
groups' feature on a search action to select namedColumn, min(numColumn),
max(numColumn) group by namedColumn

If you need to process data already in an array you could use @distinct on
col 1 to get shirts, pants. Then loop throught that, use @filter to get all
the records for each, and use @calc to get the max and min for each group.
<@assign local$distinct <@distinct array=resultset cols=1>>
<@rows array=local$distinct>
        <@assign local$temp <@filter array=resultset expr="#1=<@col 1>">>
        <@col 1> <@calc expr='min(@@temp[*,2])'> <@calc
expr='max(@@temp[*,2])'><br>
</@rows>

The first option would be preferrable.

Dave Shelley

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Chuck Lockwood
Sent: Tuesday, October 08, 2002 12:58 PM
To: Multiple recipients of list witango-talk
Subject: Witango-Talk: Array Group by?


Is there a way to group rows in an array and retrieve the min and max values
from subsequent columns, without looping through the array?

shirts,1
shirts,2
shirts,6
pants,4
pants,7
pants,2

my end result should be
pants,2,7
shirts,1,6

Thanks,

Chuck Lockwood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LockData Technologies, Inc.
309 Main Avenue, Hawley, Pa 18428
570-226-7340 ~ Fax: 570-226-7341
[EMAIL PROTECTED] ~ www.lockdata.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to