The listchoices( function builds a text array containing a list of all the values stored in a specified field.
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.
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.
|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.|