dwelling/ folder from the tutorial, run cd dwelling alone. The first excerpts quote rater.rsl in that folder.
Declare the table
Define the protection-class bands and perils inTypes:
BaseRate in Tables:
dimsdefines the lookup key.rate: Rate[Peril]returns one rate per peril.columnsmaps those rates to CSV columns.citeidentifies the source location.
Save the CSV rows
The table names its CSV file withpath, from the folder of the rater. The rows of BaseRate live in tables/BaseRate.csv:
Look up a rate
Pass the table name and key tolookup!, then select the returned value:
base_rate, and the premium reads that name:
250 × 2.60 = 650.
Tables with multiple keys
Tables with multiple keys
A table can use several key columns. The Its CSV contains one row per key combination:Pass keys in declaration order:
fn-tables example on the examples page keys its base rate by territory and construction:CSV headers with different names
CSV headers with different names
Map RSL names to the CSV headers with The
columns. This small rater reads a ZIP table whose CSV has its own headers:zip/rater.rsl
zip/tables/ZipRate.csv
columns block maps the key zip and the output rate to the two headers:Read the rate an input selects
The subscript on a map column is a map binder, such asp, or one member, such as @Peril.fire.
This small rater takes the peril as an input:
one-peril/rater.rsl
one-peril/rater.rsl
one-peril/rater.rsl
one-peril/tables/BaseRate.csv
wind, self.base_rate[self.peril] is 0.80.
An input as the column’s own subscript, .rate[self.peril], gets
E-MAP-DOMAIN.
Handle missing keys
Every lookup must find a value for each key it can receive. Choose the behavior supported by the filing:
An uncovered lookup fails
rslc check with E-LOOKUP-GAP.
Use a filed fallback
Addotherwise when the filing provides an all-other value, as the fn-tables example does:
Accept only filed keys with Key(T)
Accept only filed keys with Key(T)
For a table with one supported key column, Its input uses the table’s name in the input type:A missing key receives
Key(T) accepts values naming its filed rows.The zip rater under “CSV headers with different names” declares a five-digit ZIP type and a table:INPUT-KEY-UNFILED before rating. A wholly unfiled row also counts as missing.Represent a blank filed rate
Represent a blank filed rate
Use A row whose outputs are all
unfiled when the filing leaves an output blank. The zip rater’s CSV marks one row:unfiled is treated as absent.Restrict accepted keys, or use a filing-supported otherwise value. A lookup that can reach an uncovered missing row produces E-LOOKUP-GAP.For a table with several output cells, a partly unfiled row produces E-TABLE-COL.
Split outputs into separate tables when their filed rows differ.Locate a point in a filed grid
Some plans key a table by a grid cell that the filing assigns from the risk’s latitude and longitude. Add each cell’s filed representative point to the table, and declare the grid as a geography.grid/rater.rsl
grid/rater.rsl
grid/rater.rsl
grid/tables/Grid.csv
locate returns the key of the filed cell that holds the point, as an option:
None arm as the filing directs: refuse the risk, remove the factor, or assign a filed code.
A rater that uses locate rates on the native engine.
When the filed cells are squares of latitude and longitude, declare a degree_grid.
Its cell and origin are decimal degrees, as in the fn-geography example:
locate(WildfireGrid, …) works as it does for a projected grid.
Check the rater
Next steps
- Interpolate between table rows when the filing rates between two filed points.
- Round a premium to apply the filing’s rounding rules.
- Read the table messages to investigate table diagnostics.