TABLE returns the value from a lookup table given a certain column and row value.
SYNTAX:
TABLE(TableName, ColValue, RowValue, MatchType, GetOutside)
where :
TableName is the lookup table name. To setup a lookup table see Lookup Table Setup
ColValue an Expression (Variable, Numeric Value or Formula) that specifies the column lookup value.
RowValue an Expression (Variable, Numeric Value or Formula) that specifies the row lookup value.
MatchType specifies what to do if an exact match is not found:
- Average closest values
- Use closest value less than Lookup value
- Use closest value greater than Lookup Value
- Use exact match only
- Straight line Interpolation of values
GetOutside specifies the column or row to use if the lookup values are outside the range of the table:
0 - Return blank if outside range
1 - Use closest row or column to the lookup value
EXAMPLES:
Example 1: Use WLA table to return various numeric values.
The examples use the following WLA table:
V138 = Table("WLA",V501,V502, 2,0)
MatchType = 2, use closest value less than lookup value
GetOutside = 0, Return Blank if Lookup Value is outside the range of the table
V38 = Table("WLA", V501, V502, 3, 1)
MatchType = 3, use closest value greater than lookup value
GetOutside = 1, use closest row or column to the lookup value
The TABLE() function can be used for CT calculations; to do so, Hach WIMS has provided the necessary Lookup Tables here.
Example 2: Using a Table to return values with symbols (data qualifiers).
Only MatchTypes 2,3 and 4 can be used when returning results with symbols. Averaging and Interpolation are not supported.
TABLE("MDL",V1,V11,4,0)
NOTES: Variable 12 must be setup with Cascade Symbols on in Variable Edit. The numeric value stored will be Entered Value - i.e. <1 is 1, >6 is 6. Use the MDLV function to override if necessary.