Inventory Calculations
Configure intelligent inventory deduction rules using the Formula Builder to handle complex product configurations and material requirements.
Overview
TimberCloud's inventory calculation system lets you define exactly how inventory should be deducted based on product configurations, dimensions, and options. This is essential for businesses that:
- Sell products in different units than they stock (e.g., sell by sqft, stock by sheet)
- Need to account for waste/yield in fabrication
- Have complex material requirements based on customer specifications
The same step-based Formula Builder you use for product pricing also drives inventory calculations — learn it once, use it everywhere.
Note: Inventory management is part of TimberCloud's advanced product features, available on the Build plan and up. Multi-warehouse / multi-location stock and inventory audits require the Production plan (or Enterprise). See Subscriptions & Plans for the full breakdown.
Using the Formula Builder
The Formula Builder uses an intuitive, step-by-step approach: you assemble operands (fields, numbers, measurements, and so on) and join them with operators to describe the deduction.
Operand Types
| Type | Description | Example |
|---|---|---|
| Field | Reference order values | width, height, qty |
| Number | Static numeric value | 144, 1.10, 32 |
| Measurement | Pre-built calculations | Square Feet, Board Feet |
| Group | Parentheses ( ) | (width + 2) × height |
| Conditional | If/Then/Else logic | If width > 48 then 1.15 else 1.10 |
Operators
| Symbol | Operation |
|---|---|
| + | Add |
| − | Subtract |
| × | Multiply |
| ÷ | Divide |
Tip: When you describe pricing in the product Pricing tab, the same builder also offers an AI Formula Assistant — type a plain-English description (e.g. "charge per square foot plus 10% waste") and it generates the step-based formula for you. Today that plain-English assistant is exposed on the pricing surface; the inventory deduction builder is the same engine but is configured by hand, step by step. See the AI Pricing Assistant and the full Formula Builder reference for details.
Available Measurements
Pre-built calculations for common units handle conversions automatically:
| Measurement | Description |
|---|---|
| Square Feet | Area calculation from inches |
| Board Feet | Lumber volume calculation |
| Linear Feet | Length conversion from inches |
| Cubic Inches | Volume in cubic inches |
| Cubic Feet | Volume in cubic feet |
| Perimeter | Edge length calculation |
| Waste Factor | Apply a waste percentage |
Input Mapping
When you add a measurement, you map which line item fields provide its inputs through the visual interface.
Configuring Formulas
Where to Configure
Inventory formulas are configured on the Product Attribute:
- Go to Products → Attributes.
- Select your attribute.
- Find the Inventory Formula section.
- Click an inventory field to open the builder.
- Build your formula with the visual, step-based builder. Click Create Formula (or Edit Formula if one already exists).
- Save.
Common Patterns
Area-Based Calculations
For sheet goods, flooring, fabric, or panel products:
Scenario: Customer orders by square feet; you stock by sheet or unit.
Formula Steps:
- Add Measurement → Square Feet.
- Map width and height to line item fields.
- Add Operator → × (multiply).
- Add Field → qty.
Result: Calculates total square feet ordered.
Linear Calculations
For trim, molding, lumber, or wire products:
Formula Steps:
- Add Measurement → Linear Feet.
- Map length to a line item field.
- Add Operator → × (multiply).
- Add Field → qty.
Result: Converts length from inches to feet and multiplies by quantity.
Volume Calculations
For concrete, mulch, gravel, or bulk materials:
Formula Steps:
- Add Measurement → Cubic Feet.
- Map width, height, and depth to line item fields.
- Add Operator → × (multiply).
- Add Field → qty.
Result: Calculates total cubic feet ordered.
Board Feet
For lumber inventory and sales:
Formula Steps:
- Add Measurement → Board Feet.
- Map thickness, width, and length to line item fields.
- Add Operator → × (multiply).
- Add Field → qty.
Result: Calculates board feet using the lumber-industry standard formula.
Adding Waste Factors
Account for material waste in cutting, fabrication, or installation:
Static Multiplier
Add a fixed percentage of waste:
- Create your base calculation.
- Add Operator → × (multiply).
- Add Number →
1.10(for 10% waste).
Example: Square Feet × qty × 1.10
Waste Factor Measurement
Use the built-in waste calculation:
- Add Measurement → Waste Factor.
- Map the quantity field.
- Set the waste percentage (e.g., 10).
Dynamic Waste with Conditionals
Different waste for different scenarios:
- Add your base calculation.
- Add Operator → × (multiply).
- Add Conditional:
- If:
width > 48 - Then:
1.15(15% waste for large panels) - Else:
1.10(10% waste for standard)
- If:
Conditional Logic
Handle different scenarios with If/Then/Else:
Based on Dimensions
If width > 48
Then: 1.15 (15% waste for large pieces)
Else: 1.10 (10% waste for standard)Based on Product Options
Access selected option values using dot notation:
If material.hardness > 5
Then: 1.20 (20% waste for hard materials)
Else: 1.10 (10% waste for soft materials)Comparison Operators
| Operator | Description |
|---|---|
> | Greater than |
< | Less than |
≥ | Greater or equal |
≤ | Less or equal |
= | Equals (number) |
≠ | Not equals |
is | Equals (text) |
contains | Contains text |
Variables Available
Line Item Fields
Direct access to customer-entered values:
qty— Quantity orderedwidth— Item widthheight— Item heightdepth— Item depthlength— Item length- Custom line item fields you've defined
Product Option Values
Access selected attribute values using dot notation:
attribute_name.part_nameExamples:
material.thickness— Selected material's thickness valueedge_banding.price_per_ft— Edge option's pricefinish.coverage_sqft— Finish coverage rate
The same dot notation works in pricing formulas, so the field references you learn here carry over directly.
Quick-Start Templates
The builder includes common formula templates:
| Template | Use Case |
|---|---|
| Quantity Only | Simple products sold by unit |
| Board Feet × Qty | Lumber products |
| Linear Feet × Qty | Trim, molding, wire |
| Square Feet × Qty | Sheet goods, flooring |
| Field × Qty | Custom field deduction |
Formula Examples
Plywood Sheets
Deduct sheets based on area (32 sqft per sheet):
Square Feet × qty ÷ 32Lumber Boards
Calculate board feet for inventory:
Board Feet × qtyEdge Banding (per edge)
Calculate linear footage for edges:
Perimeter × qty ÷ 12With Dynamic Waste
Panel cutting with size-based waste:
(Square Feet × qty) × (If width > 48 Then 1.15 Else 1.10)Testing Calculations
Before Going Live
- Save your formula.
- Create a test order with known dimensions.
- Verify the calculated deduction matches what you expect.
- Test edge cases:
- Minimum values (qty = 1, small dimensions)
- Maximum values (large orders)
- Decimal values (10.5, 3.14)
- Boundary conditions
Debugging Tips
- Check field names — Ensure formula references match line item fields exactly.
- Verify mappings — Confirm measurement inputs map to the correct fields.
- Test simple first — Start with a basic formula, then add complexity gradually.
Troubleshooting
Incorrect Results
- Verify formula logic step by step.
- Check field mappings in measurements.
- Confirm unit conversions are correct.
- Review operator order — use groups if needed.
- Check for rounding if precise values are expected.
Formula Not Working
- Ensure all inputs are mapped — measurements need every input.
- Check for empty fields — missing values default to 0.
- Verify the formula has valid steps — at least one operand is needed.
- Test with simple known values first.
Best Practices
- Start Simple: Begin with basic formulas and add complexity as needed.
- Use Measurements: Pre-built measurements handle unit conversions correctly.
- Test Thoroughly: Verify with real order scenarios before going live.
- Document Logic: Note why specific waste factors or multipliers are used.
- Group Complex Math: Use parentheses to enforce the correct order of operations.
Related Topics
- Formula Builder — Complete formula builder reference (operands, measurements, variables, AI assistant)
- AI Pricing Assistant — Generate step-based pricing formulas from plain English
- Inventory Overview — Inventory system introduction
- Inventory Management — Stock operations and tracking
- Product Pricing — Use the same Formula Builder to price your products
- Parts — Configure product components