Progress
Report Builder
User’s Guide


IN-LIST

Compares a given value with each item in a list of values to determine whether the value is included in the list. Report Builder compares the first value with each value in the list. If it does not find a match, IN-LIST returns 0. If it does find a match, it returns a number corresponding to the position of the value in the list (that is, 1 for the first value, 2 for the second value, etc.).

SYNTAX

IN-LIST ( value , list-value1 , ... , list-value-n ) 

value

A value (a constant, field name, or expression) that you want to look up within a list of values.

list-values

List of values Report Builder compares with the value. You must have at least one list-value in the value list.

NOTE

The value and all the list-values must be the same data type: CHARACTER, NUMERIC, DATE, or LOGICAL expressions. Also, if the same value appears twice in the list, Report Builder returns the position of the last (rightmost) matching value.

EXAMPLE

To test each record in the Items table to determine whether its item code field (Item-num) is one of three items in a list, create a calculated field containing this expression:

IN-LIST(Item-num,901,902,903) 

Sample data:

Item-num   IN-LIST(Item-num...)
904             0
903             3
901             1
911             0
902             2 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095