Declare the tables
dimsnames the key columns. A key is an enum, a band type, aCodeorBool.- The names after
->are the output columns, such as a rate or a factor. - The citation after the table name points to the page that prints the table.
columnsmaps a column name to a CSV header with a different name.Territoryis a code: a three-digit string.Codeaccepts any string that fits the pattern.otherwisegives the factor for each territory the CSV leaves out.
Write the rows
Each table reads its rows fromtables/ plus the table name and .csv. tables/BaseRate.csv:
tables/TerritoryFactor.csv:
- An enum cell holds the member’s name, as a request sends it.
- A band cell holds the band’s first value, such as
4for the band 4 to 6. - A number cell holds digits with an optional decimal point.
Read the tables
lookup! takes the table and one key for each key column, in order. Read an output column after
the dot:
relativities-examples/rsl/table-otherwise:
otherwise factor of 1.25.
Handle the keys the filing leaves out
Each lookup has to find a row. Take out theotherwise row, and territory 999 lacks a row. The check
stops:
Accept only the keys the table lists
Key(TerritoryFactor) accepts only the territories that TerritoryFactor lists. The rater refuses
any other territory before it calculates:
relativities-examples/rsl/table-key:
Key(T) works on a table with one key column, of a Code or enum type.
Mark a row the filing leaves blank
Some filings print a row with a blank value, such as a log home that lacks a construction factor. Writeunfiled in that cell:
Construction - { log } form the message
suggests. The rater then refuses a log home with that rule’s code:
Key(ConstructionFactor) also works here. It refuses a log home with INPUT-KEY-UNFILED.
Related
- What rslc checks and guarantees shows the band key message,
E-KEY-RANGE. - RSL at a glance reads a table with one rate per peril.