ArrayDeduplicate procedure
Gary Yonaites
gary at yonaites.com
Thu Mar 20 18:49:58 PDT 2008
If it was from one of my posts, I can't find in anywhere. Here is a
possible solution from the here and now:
ArrayFilter MyArray,MyArray,¶,
?(arraysearch(arrayrange(arrayreverse(MyArray,¶),1,
arraysize(MyArray,¶)-seq(),¶),import(),1,¶)=0,import(),"")
MyArray =arraystrip(MyArray,¶)
The ArrayFilter formula searches the reversed version of the original
array from the first element to just before the point in the array we
are currently working on using the arraysize(-seq(). If it finds a
match it means the same element already exists in the new array so we
do not add it. If it does not find a match it imports the current
element. The last line strips the empty elements. This should keep
the same order as originally presented but remove the duplicates.
Gary
gary at yonaites.com
On Mar 20, 2008, at 6:28 PM, Michael wrote:
> Somebody posted a very elegant solution to this problem a year or two
> back - perhaps Gary Yonaites. No doubt he will resurrect it and post
> it again for you.
>
> michael
>
> On 21/03/2008, at 10:49 AM, Jim Bailey wrote:
>
>> ArrayDeduplicate sorts the resulting array. Is there a simple way
>> to perhaps arrange one of the other Array procedured to perform the
>> deDuplication without the sort. I need my array in the same order
>> as the field from which it is derived but without any of the
>> duplicate entries.
More information about the Qna
mailing list