Home > Expression Operators > Array Operators > #GETTABVAL

#GETTABVAL

This operator returns the value in a table that corresponds to a set of lookup values. If no match is found, it returns 0. In a data default expression, #GETTABVAL can also be used to return all the values in a column. #GETTABVAL is available in data default expressions, salary and service transformation expressions, Benefit Definitions, Accrual Definitions, and SubFormulas.

Syntax:

a #GETTABVAL b

where:

a is the name of the CSV or space delimited TXT file containing the table, in quotes (e.g., "RegMaxComp.txt"), or it's a scalar value created by assignment (e.g., a:= "RegMaxComp.txt"). The name does not include a path, and the file extension is optional.  If the extension is missing, ProAdmin looks for .CSV and then .TXT files in each of the standard search directories.  If the extension is specified, ProAdmin looks for the exact file name in each of the standard search directories.

Note: You cannot create scalar character strings (e.g., a:= "RegMaxComp.txt") in Benefit Formulas, subformulas, or basis formulas because (internally) ProAdmin automatically creates an array with a calculation dates number of identical values.

b is a parenthesized list of temporary variables (created by temporary assignment) that are used to look up a value in the table specified by a. In Benefit Definitions, Accrual Definitions and Subformulas, b may include components.

In a data default expression, if you append a ? to the file name (e.g., 'RegMaxComp.txt?'), then b is the index of the column you want returned. For example, 'RegMaxComp.txt?' #GETTABVAL (1) returns all the values in the first column found in the file RegMaxComp.txt. If you ask for a column that doesn't exist (e.g., 'RegMaxComp.txt?' #GETTABVAL (9999)), then zeroes are returned (one zero for each row in the table).

If the set of lookup values (b) corresponds to a value in the specified table (a), then that value is returned; otherwise, 0 is returned.

The GETTABVAL file containing the values and their associated lookup values must have the following characteristics:

    1. Client directory
    2. Regulatory files (per RegPath setting)
    3. User directory
    4. System directory (i.e., directory where ProAdmin is installed)
    5. Historical interest rate directory HIRTDIR (as specified in the proadmin.ini file; only used if HIRTCODE=2)

    For ProAdmin Server (and Calculator Testing), the Client and User directories are not defined (ignored), and this is the search order:​

    1. Regulatory files (per RegPath setting) 
    2. System directory (i.e., directory where ProAdmin is installed)
    3. Historical interest rate directory HIRTDIR (as specified in the proadmin.ini file; only used if HIRTCODE=2)
    1. E = exact match (e.g., Location or Plan)
    2. R = range match (e.g., Effective Date). If the date lookup range is 1/1/2000 to 12/31/2000, the indicator for this range is 1/1/2000. If a salary lookup range for a value is from $20,000 up to but not including $25,000, the indicator for the $20,000 value is 20,000 and the indicator for the $25,000 value is 25,000.
    3. I = ignore this column. Since #GETTABVAL only works with dates and numbers, you might, for example, want to include a column with the location name next to the column with the location code. Use an “I” to tell #GETTABVAL to ignore the column with the descriptor.
    4. V= value. This column contains the values you want #GETTABVAL to retrieve.

Now, all the values in the table are numbers, ProAdmin codes (which are numbers), and dates.

Some additional pointers when using #GETTABVAL are:

 

Some additional #GETTABVAL topics:

Range vs Exact Matches
Range Order Matches
Using large CSV or TXT files
Example: Limit salary in a transformation by 401(a)(17)
Example: Assumed hours per day vary over time
Example: Load 401(a)17 limits into an effective date array