Yes,
Step 1, do a <@DISTINCT> on column 1, this will be the array you loop through
begin loop:{
Step 2, perform an <@FILTER> on column 1 of your original array using the current row
from the distinct array as the filter value
Step 3, perform a <@CALC min()> and an <@CALC max() > on the filtered array
} // end loop:
Or:
<@ASSIGN Name=NewArray VALUE=<@DISTINCT ARRAY=OriginalArray COLS=1>>
<@ROWS ARRAY=NewArray>
<@ASSIGN Name=TheseValues VALUE=<@FILTER ARRAY=arrayVarName EXPR="#1='<@VAR
NewArray[<@CURROW>,1]>'">>
<@! COMMENT="Print values:">
<@VAR NewArray[<@CURROW>,1]>, <@CALC 'min(@@TheseValues[*,2])'>, <@CALC
'max(@@TheseValues[*,2])'>
</@ROWS>
-----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