arraydeduplicate
OLDARRAY
,
NEWARRAY
,
SEPARATOR

The arraydeduplicate statement removes duplicate elements from an array (see Text Arrays).


Parameters

This statement has three parameters:

oldarray – is a formula that calculates the original array. Usually this is a text field or variable, but it is allowed to be any formula that produces a text result.

newarray – is the variable or field that will contain the new array. If you use a field for this parameter it must be a text field. If you want to change the array in place, use the same field or variable for both the oldarray and the newarray

separator – is the separator character or characters for the array, often a carriage return, tab or comma.


Description

The ArrayDeduplicate statement removes duplicate elements from an array. As a side effect it also sorts the array into alphabetical (A-Z) order.

The example builds an array containing a list of all the cities in Vermont where you have customers. Since you may have more than one customer in a given city, the arraydeduplicate statement removes the extras and makes sure each city is listed only once.

local Cities
select State="VT"
arrayselectedbuild Cities,cr(),Customer,City 
arraydeduplicate Cities,Cities,cr()

See the arraydeduplicate( function for additional explanation and examples.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0 but more than one character is now allowed for use as the separator parameter.