How to work with variables in a formula
This allows different formula or constants to operate depending on the answer to a variable.
For example, if there are two ranges of products DELUXE and STANDARD they may be of similar construction but with different thickness and some different machining.
Use variables to change the constants and formula at order time and so use a single set of product definitions.
Here are the different constants and formula for the two ranges in the formula table.
Formula name Value
DELUXE_SHELFDEPTH 300
STANDARD_SHELFDEPTH 250
DELUXE_QTYSHELFHOLES X/3
STANDARD_QTYSHELFHOLES X/2
The part defining the shelf would appear in the product definition as follows.
BOOKCASE /073
Small Bookcase
Width:
Height:
Depth:
Part Qty Descr Material Length Width
PX/101 1 Shelf TEAKLAM 940.0 &@STYLE@_SHELFDEPTH&
In this example the shelf width is defined by the expression.
&@STYLE@_SHELFDEPTH&
@STYLE@ is a variable which is entered at the order stage and would be either DELUXE or STANDARD. So that the expression is evaluated to the one of the following items.
DELUXE_SHELFDEPTH
STANDARD_SHELFDEPTH
The actual value or formula can then be found from the formula table.
Using constants in formula - store a constant in the formula table by omitting the = symbol
Notes
- Blank formula and constants are not allowed.