LookUp (Range)
Use this function to compare a value with a range of values in a table, and to return a character string.
Syntax:
where:
- Range is the name of the lookup method.
- Table is the name of an ASCII file containing the table of values to be referenced by the LookUp function.
- SourceSymName is a symbol in the dimension specifying the criteria for selection.
- CompareSymName is a symbol containing a numeric data value.
Table format
Without the CompareSymName:
LowerRange, UpperRange @ ReturnValue
Example (table):
3, 4 @ LINE1
10,15 @ LINE2
110,230 @ LINE3
With the CompareSymName:
CompareSymName, LowerRange, UpperRange @ ReturnValue
Example (table):
9, 3, 4 @ LINE1
10, 10,15 @ LINE2
11, 110,230 @ LINE3
Note: If the compare value is not found, it will return "NOT FOUND".
Syntax example (without CompareSymbol)
If the RangeLookupTable contains the entries shown above and CASH1 contains 12, the value of LINE2 is returned (lines 2, 3, and 6 all match the range but the one with the upper range closest to 12 is line 2).
Syntax example (with CompareSymbol)
If the RangeLookupTable2 contains the entries shown above and SALES2 contains 224 and CASH1 contains 11, these four lines match the criteria:
11,110,230 @ LINE3
11,177,210 @ LINE4
11,200,225 @ LINE6
11,222,229 @ LINE8
Since the source symbol is 224, only three are within this range and LINE6 contains the upper range that is closet to the source symbol (225). The function returns LINE6 to SALES5.