Skip to main content

Price scales

How to create and configure price scales to sort boats into categories (per m², HP, kW…).

A Price scale is the axis along which the detailed pricelist classifies boats. It does two things:

  1. calculates a single number from the boat's data through a formula (the Value expression field);

  2. compares that number with an ordered list of Bands to pick the right category/row, using a Match mode.

The same scale can be used by several grids (e.g. the same “m²” scale serves both haul-out and antifouling).

Note. A scale can classify in two ways: by a number calculated from the boat's data (the way described here) or directly by “Dimension class”, i.e. the marina's size classes. The choice is in the “Classify by” field (see “Dimension class scale” further down).

Where to find it

Settings → Prices lists, products and services → Price scales (detailed pricelist) opens the list of scales. For each one you see Name, Code, Match mode, the number of Bands, the number of Grids that use it (one click shows those grids) and whether it is Enabled. The row actions are View, Edit, Duplicate and Delete; “New price scale” opens the form for a new scale.

A scale's page shows the Configuration (how it classifies, with the Edit & test button next to the Value expression), the Bands panel with “Add band” and the Grids using this scale panel. In the Actions panel you find Update price scale, Duplicate this scale (it also copies all the bands), Check this scale, Create price scale and Manage price scales (back to the list). To try a formula while you write it see The formula editor: scripts and live test. To see the scales you need the Prices lists → Read permission; to create, edit and delete them, Prices lists → Create, Edit and Delete (see Detailed pricelist: getting started).

Creating a scale

  1. From the list press “New price scale”.

  2. Fill in the Name (required) — e.g. Surface or Engine power.

  3. Fill in the Code (short abbreviation, e.g. boat_mq, engine_hp): it is used to refer to the scale internally.

  4. Choose the Match mode (see below).

  5. Set Ordering and Enabled (Yes/No).

  6. Write the Value expression: a single mathematical expression that returns one number calculated from the boat (e.g. boat.length * boat.width). You can click a field or an example in the help panel under the box to insert it.

  7. Press “Create scale” (when editing the button is “Save scale”).

Adding the bands

From the scale's view, in the “Bands” panel:

  1. Press “Add band”.

  2. Fill in Label (the category's name), Band index (already filled in with the next position), Min value and Max value.

  3. Leave one of the two limits empty to make it unlimited (empty minimum = no lower limit; empty maximum = no upper limit).

  4. Press “Create band” (when editing: “Save band”). Use the pencil icon to edit and the X to delete a band.

Tip: make the first and the last band unlimited (empty minimum on the first, empty maximum on the last) so that every boat, even one outside the scale, still falls into a category.

The Value expression: what you can use

Here you can only use the boat's and the berth's data:

  • boat.* — e.g. boat.length, boat.width, boat.mq, boat.draught, boat.displacement

  • engine.* — e.g. engine.hp, engine.count

  • generator.* — e.g. generator.kw_max

  • resource.* — the berth's dimensions

plus the functions IF, MIN, MAX, ROUND, CEIL, FLOOR, ABS, AND, OR, NOT, the operators + - * / and parentheses.

params.*, period.*, band.*, cell.value, prev are not available here: they belong to grids, not to scales. For details see the article Expressions.

Typical examples (the same ones you find in the field's help):

Rule

Value expression

Classify by surface (m²)

boat.length * boat.width

Classify by engine power

engine.hp

Classify by largest generator

generator.kw_max

Classify by length only

boat.length

The three match modes

The mode decides how the calculated number picks the band.

Mode

Meaning

When to use it

Range (min ≤ value ≤ max)

Picks the band whose [min, max] range contains the value.

When you have explicit categories like “0–10”, “11–20”.

Nearest up (next larger threshold)

Picks the band with the smallest maximum threshold that is still ≥ the value.

“Threshold” tables (like an approximate lookup).

Nearest down (next smaller threshold)

Picks the band with the largest minimum threshold that is still ≤ the value.

“Threshold” tables, downwards.

Example: the same boat, the three modes

Surface scale with boat.length * boat.width. A boat of 12 × 4 m gives 48 (m²).

  • With bands 0–30, 30–50, 50–80 in Range mode, the value 48 falls in the 30–50 band (because 30 ≤ 48 ≤ 50).

  • With maximum thresholds at 30, 50, 80 in Nearest up mode, it picks the band with max 50 (the first threshold ≥ 48).

  • In Nearest down mode, it picks the band that starts at 30 (the last threshold ≤ 48).

Dimension class scale

Besides the “by number” mode seen so far, a scale can classify directly by the marina's size classes. In this case the bands ARE the classes: no formula, no minimum/maximum values.

You choose it when you create (or edit) the scale, in the “Classify by” field:

  • “Numeric value (expression + bands)” — the classic mode described above (Value expression + min-max bands);

  • “Dimension class (the port’s own size classes)” — the bands coincide with the marina's size classes.

When you choose “Dimension class” the form changes: “Value expression” and “Match mode” disappear, and the “Dimension source” field appears, i.e. whose class to read:

“Dimension source”

Reads the class from…

“Boat”

the boat

“Berth (resource)”

the assigned berth

“Tenant default (boat or berth per settings)”

the marina's general setting

Then save the scale (“Create scale” / “Save scale”) and add the bands from its page.

Adding the classes as bands

On the scale's page you add bands with “Add band”: here, instead of the minimum/maximum values, you pick a “Dimension class” from a dropdown (by name, e.g. “Class C”). No numbers to enter.

Faster, the “Add all classes of type:” box (it appears only in these scales): choose a type from the dropdown (“Select a type…”) and press “Add all classes”. It creates in one go one band for each class of that type, with the class name already as the label; classes already present are skipped (no duplicates).

Note. In the bands table the “Dimension class” column shows the class linked to each band: in dimension class scales it is filled in (and the minimum/maximum values stay empty), in numeric scales it is the opposite.

Checking a scale

To see how the scale classifies a real boat, open the scale and press Check this scale in the Actions panel. In the What to check panel choose a Boat and/or a Berth (resource) (at least one) and press Run the check. The Result shows, for a numeric scale, the Computed value; for a dimension class scale, the Dimension class read and where it comes from. Below it appears the band it falls into (“Classified into band:”), or “No band matches — the input falls outside every band of this scale.”. Nothing is saved.

It is the right tool for the “boat outside all the bands” error described below.

Mistakes to avoid

  • The value expression must return a single number. If you leave it empty, the scale produces nothing and no band is chosen.

  • Using the wrong variables. In scales you can only use boat.*, engine.*, generator.* and resource.*. Using params.*, period.*, band.* or cell.value here makes the expression fail.

  • Band limits are inclusive on both sides (min ≤ value ≤ max). Avoid overlapping bands: in Range mode the first band (by index) whose range contains the value would be chosen.

  • Empty ≠ zero. Leaving a limit empty makes it unlimited, it does not set it to 0. For the “open” first/last band leave the limit empty, don't write 0.

  • Min greater than max. If you set both limits and the minimum exceeds the maximum, saving the band is refused with “The max value must be greater than or equal to the min value.”.

  • Boat outside all the bands. In Range mode, if no band contains the value the boat is not classified (the line will be skipped). See the tip above about unlimited bands.


Did this answer your question?