lookupDateRange

Matches dateValue against a series of dates in the standard choices called stdChoiceEntry.

Version

1.4

Parameters

Parameter Type Description
stdChoiceEntry string Item Name of standard choices used as lookup table.
dateValue string Date that determines which row to return. Use string in format MM/DD/YYYY, e.g. "07/21/2000".
valueIndex (optional) integer Determines the value to return. Defaults to 1, the first value.

Returns

If dateValue falls after date 1 but before or on date 2, returns the value following the caret (^) on date 1's right. If the function uses the valueIndex parameter, returns the value immediately after the valueIndex'th caret (^), following the matching date.

Notes

Set up the standard choices lookup table as follows:

  • Value column = Four digit incremental index.  Must be left zero padded to four digits.  Entire table must be consecutive.

  • Value Desc column = at least two values separated with the caret (^) symbol. Returns the first value as the effective date (MM/DD/YYYY format). Returns the remaining values by the function.

Examples


738390219@19072007-154F

lookupDateRange("test date lookup","5/5/2002")  returns 33333

lookupDateRange("test date lookup","1/5/2000",2) returns 12222

lookupDateRange("test date lookup","1/1/2010") returns 44444

lookupDateRange("test date lookup","1/1/1999") returns undefined since there is no entry effective for that date.

lookupDateRange("test date lookup","1/5/2000",3) returns undefined since there are not 3 values.

Sample script controls:

01  appMatch("Building/Residential/SFD/*") ^lookupIndex=1
02  appMatch("Building/Residential/Duplex/*") ^ lookupIndex = 2
03  true ^ addFee("FEECODE","FEESCHED","FEEPERIOD", lookupDateRange("test date lookup", filedate, lookupIndex), "Y")