listchoices(
listchoices(
FIELD
,
SEPARATOR
,
THRESHOLD
)

The listchoices( function builds a text array containing a list of all the values stored in a specified field.

Parameters

This function has three parameters:

field – is the name of the field that contains the values you want build a list of.

separator – is the separator character for the text array you are building (see Text Arrays). This parameter is optional, if it is omitted, carriage returns will be used as separators.

threshold – specifies the minimum number of occurences required for a value to be included in the output list. This parameter is optional, if it is omitted then the default threshold is 1, meaning that all values in the database will be listed.

Description

This function builds a text array containing a list of all the values stored in a specified field. The list is returned as a Text Array. The listchoices( function is often used to build pop-up menus or list objects.

Here is a formula that builds a list of the states in the current database.

    listchoices(State,",") ☞ CA,AZ,NV,OR,UT,CO,WA,NM,KS,OH

Here is an alternate version that only lists states that appear 5 or more times in the database.

     listchoices(State,",",5) ☞ CA,AZ,OR

As the threshold is increased, fewer results are returned. In this case, California is the only state that appears at least 25 times in the database.

     listchoices(State,",",25) ☞ CA

Note: The result returned by the listchoices( function are not returned in any particular order. To sort them alphabetically, use the arraysort( function.

See Also

- arraydeduplicate -- removes duplicate elements from an array (see Text Arrays).
- arrayintegersort -- sorts all the numeric elements of a text array in proper numeric order.
- arraynumericsort -- sorts all the numeric elements of a text array in proper numeric order.
- batchreplace( -- performs multiple find/replace operations on a piece of text.
- lookupall( -- builds a text array containing one item for every record in the target database where the data in the keyField matches the keyData. Each item in the text array contains the value extracted from the dataField for that record. If the data field is a numeric or date field, it is converted to text using the default patterns for that field.
- lookupalldouble( -- is similar to the lookupall( function, but it returns two fields from the target database instead of just one.
- lookupalloctet( -- is similar to the lookupall( function, but it returns eight fields from the target database instead of just one.
- lookupallquadruple( -- is similar to the lookupall( function, but it returns four fields from the target database instead of just one.
- lookupallquintuplet( -- is similar to the lookupall( function, but it returns five fields from the target database instead of just one.
- lookupallseptuplet( -- is similar to the lookupall( function, but it returns seven fields from the target database instead of just one.
- lookupallsextet( -- is similar to the lookupall( function, but it returns six fields from the target database instead of just one.
- lookupalltriple( -- is similar to the lookupall( function, but it returns three fields from the target database instead of just one.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but now allows you to set the threshold. Also allows the separator parameter to be omitted.