David,

   This worked perfectly! Thank you! 

-----Original Message-----
From: David Shelley [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 16, 2006 8:53 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Array processing


Another way to do this would be to create an array of all the rows in array1
that are not in array2, and an array of all the rows in 2 that are not in 1,
then append them together.

<@assign local$array1 <@array value="1;2;4;5;6;">>
<@assign local$array2 <@array value="2;3;4;5;6;7;">>

<@assign local$in1not2 
        <@filter array=local$array1 expr="!(@@local$array2 contains #1)">>
<@assign local$in2not1 
        <@filter array=local$array2 expr="!(@@local$array1 contains #1)">>

If both arrays are not empty then 
        the result is local$in1not2 + local$in2not1
Else if local$in1not2 is not empty
        the result is local$in1not2
Else 
        the result is local$in2not1 


<@if expr="<@numrows array=local$in1not2>>0 && <@numrows
array=local$in2not1>>0">
        <@assign local$result @@local$in1not2>
        <@addrows array=local$result value="@@local$in2not1">
<@elseif expr="<@numrows array=lcoal$in1not2>>0">
        <@assign local$result @@local$in1not2>
<@else>
        <@assign local$result @@local$in2not1>
</@if>

@@local$result then contains the values 1;3;7;

Note that though this method uses only 2 filters and an addrows to implement
an exclusive or, the filter statements can be quite slow if the arrays are
large.

Also, I ran the code above through my tango debugger an it works, however
some modifications will be required for multi-column arrays or when doing
the comparison on a variable column number.

Dave Shelley

-----Original Message-----
From: Wolf, Gene [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 16, 2006 5:23 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Array processing

This would give me all members of both arrays. Yes, I could then use that to
look at each individual array and if the number in the Union'd array did not
appear I could build my own list. I was just hoping that there was some
function I may have overlooked that would do this for me. *laughs*
Apparently not from the responses. Sounds like it's time for me to build a
tcf to do this.

-----Original Message-----
From: Matt Muro [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 16, 2006 5:14 PM
To: witango-talk@witango.com
Cc: witango-talk@witango.com
Subject: Re: Witango-Talk: Array processing


Just a thought as I run out the door here (I haven't tried this) ...

What about using <@UNION> to combine the arrays and then performing
<@DISTINCT> on the combined array to have only the DISTINCT elements
returned.



witango-talk@witango.com on Thursday, February 16, 2006 at 5:03 PM -0500
wrote:
>   Not at all. Assume I have array 1 with the following rows:
>
>1
>2
>3
>4
>5
>
>And I have Array 2 with the following rows:
>
>2
>3
>5
>6
>7
>
>I'd like to have some kind of function that would tell me all of the
>elements of these two arrays that do not appear in BOTH arrays, those
>being 1,4,6,7. Does that help?
>
>-----Original Message-----
>From: Scott Cadillac [mailto:[EMAIL PROTECTED]
>Sent: Thursday, February 16, 2006 4:59 PM
>To: witango-talk@witango.com
>Subject: RE: Witango-Talk: Array processing
>
>
>Hi Gene,
>
>> I need something that compares 
>> two arrays and returns to me those rows that do not exist in 
>> BOTH arrays.
>
>I don't get it. Is this a trick question?
>
>
>Scott Cadillac, 
>Email: [EMAIL PROTECTED] 
>http://scott.cadillac.bz 
>
>
>  
>
>> -----Original Message-----
>> From: Wolf, Gene [mailto:[EMAIL PROTECTED] 
>> Sent: Thursday, February 16, 2006 2:42 PM
>> To: witango-talk@witango.com
>> Subject: Witango-Talk: Array processing
>> 
>>     I've seen a number of the array processing commands like 
>> @intersect, @Union, etc. but I need something that compares 
>> two arrays and returns to me those rows that do not exist in 
>> BOTH arrays. Is there anything like the equivalent of 
>> [EMAIL PROTECTED] *laughs* 
>> ______________________________________________________________
>> __________
>> TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>> 
>
>
>________________________________________________________________________
>TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>________________________________________________________________________
>TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>




________________________________________________________
Matt Muro                                      [EMAIL PROTECTED]
Harvard University                           phone:  617.998.8522
Division of Continuing Education       fax:      617.495.9176

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to