Skip to main content

The Estimator

Basics and benefits of the Estimator

Patric avatar
Written by Patric
Updated over 3 weeks ago

⚡ Quick Calculations with the Estimator

The Estimator in Keyline is designed to make calculations not only reliable but also particularly fast and easy. At its core is a flexible formula model, which can be extended and refined using lookup tables.

These tables allow you to represent even complex pricing logic in a clean and structured way – for example, by using multi-dimensional price matrices that take several influencing factors into account at once.

Example:

By creating a three-dimensional lookup table, you can represent various combinations of parameters such as format, quantity, and color mode – and automatically calculate the correct price for a given component based on that data.

This approach ensures that your calculations stay clear, consistent, and fully traceable – whether you’re working with standard products or custom-made one-offs.

🧩 Structure & Setup of the EstimatorAn Estimator consists of one or more pricing components that together form the complete calculation. The structure is fully flexible and can be adapted to your product or process:

🔹 Any number of pricing components

Each estimator can contain as many components as needed – from printing and finishing to shipping or additional surcharges.

🔹 Variable or fixed costs

For each component, you can define whether it represents variable costs (e.g., based on quantity or format) or fixed costs (e.g., setup or tooling costs).

🔹 Descriptions for better clarity

To ensure full transparency and traceability, you can add a custom description to each pricing component. This makes the logic and purpose of each calculation instantly clear – especially helpful in complex models or for future maintenance.

At the same time, formulas remain compact and easy to understand.

🧮 Formula Structure per Pricing Component

Each pricing component includes the same four formula fields:

  • Formula for internal costs

  • Formula for external costs

  • Formula for labor costs

  • Formula for material costs

This separation ensures a clear and consistent structure:

In the calculation view, the different cost types are displayed separately and clearly, which improves transparency and makes the cost breakdown easy to understand at a glance.

🎛️ Custom Variables per Pricing Component

Each pricing component can have its own set of custom variables, which are individually queried in the input form.

These variables can be of different types, such as:

  • Decimal numbers (e.g. for dimensions or quantities)

  • Text inputs (e.g. for product names or notes)

  • Boolean values (yes/no options)

This allows for flexible data input tailored to your specific calculation needs.

Each variable also has a technical name, which defines the path in the input JSON.

This allows you to set values programmatically via the API – ideal for automated workflows or system integrations.

If you want to display a dropdown in the input form, you can link the variable to a lookup table.

This allows predefined values to be selected easily – ideal for standardized options or frequently used parameters.

The API URL and your token can be found directly under API access:

https://www.keyline.app/estimations/api/v1/estimations

Each Estimator can be set to either private or public.

This setting affects the response you receive via the API:

  • Private Estimators return detailed calculation data and intermediate results.

  • Public Estimators return only the final calculated price – ideal for integration with external systems or for sharing with customers.

Additionally, you can define helper variables based on previously calculated values.

For example, it can be useful to first calculate the required material area in square meters and then use this value as a basis for further calculations involving surcharges or other factors.


📊 Lookup Tables

Lookup tables are simple Excel spreadsheets that serve as the basis for calculations in the estimator. They can contain one, two, or a maximum of three dimensions, such as:

  • Columns (e.g. formats)

  • Rows (e.g. quantities)

  • Sheets (e.g. different machines or material types)

To keep things manageable, we recommend working with no more than three dimensions.

The structure of these lookup tables is defined when they are created in the system and forms the foundation for linking them to formulas in the Estimator.

At the bottom of this article, you’ll find an example of a lookup table to help you understand its structure and setup.

Once successfully uploaded, you can:

  • search for specific values in the table

  • download the entire table as an Excel file

  • or edit the data directly within the system

This gives you full control over your pricing matrix at all times – without the need for additional tools.

📈 Interpolation Between Values

You also have the option to interpolate between two defined values.

Example:

If your lookup table contains quantities for 200, 300, and 500, and a calculation is run for 350, the system will automatically calculate the appropriate average between 300 and 500.

👉 This way, you get a realistic, dynamically calculated price even for values that are not explicitly listed – without the need for additional formulas.

⚠️ Important Note on Interpolation

Please note: Only one interpolation per lookup table is possible.

This means it’s not possible to interpolate across multiple axes – for example, the X and Y axes of a multi-dimensional table.

✅ Interpolation works only one-dimensionally, for example over a single quantity scale such as print runs.


🔢 General Functions

In the price component, you could define the formula like this, for example:

(LOOKUP("Your-LookUp-Table_ID", circulation, number_of_pages, mashine_typ)*100)*circulation

If a default value should be returned when no matching value is found in the table, you can use:

(LOOKUP_WITH_DEFAULT("YOUR-LookUp-Table_ID", 1000, circulation, number_of_pages, Machine_type) * 100) * circulation

In this case, 1000 will be returned if no value is found for the given parameters.

Instead of 1000, a more complex calculation or another formula can be used.

Available Functions & Variables:

You can use various functions and operators, including:

Logical Operators & Conditions:

if, not, min, max, sum, and round


Mathematical Functions:

<, >, <=, >=, <>, !=, =,

IF, AND, OR, XOR, NOT, SWITCH, MIN, MAX, SUM, AVG, COUNT, ROUND, ROUNDDOWN, ROUNDUP, ABS, INTERCEPT


Examples:

Finding Minimum or Maximum Values:

Max(10,9,8,7) => 10

Min(10,9,8,7) => 7


Rounding Examples:

Round(8.3) => 8

Round(8.5463,2) => 8.55 (der zweite Wert bestimmt die Dezimalstelle, auf die gerundet werden soll
Rounddown(55.55) => 55

Roundup(55.55) => 56
Round(Seitenanzahl/2)*2 => Ensures the result is always an even number


Range Switch Function:

RANGESWITCH(number_of_pages,1,64,64,65,128,128,129,240,240,241,300,300,11111)

If PageCount is:

• Between 1 and 64 → Returns 64

• Between 65 and 128 → Returns 128, etc.


Switch Function (Direct Mapping):

SWITCH(PageCount,8,80,16,160,200,2000,11111)

If PageCount is 8, it returns 80.

If PageCount is 200, it returns 2000.

If no matching value exists, it returns 11111.


Alternatively, you can of course also use a nested if/then function:


IF(placeholder_with_twenty<=5, 1, IF(placeholder_with_twenty<=10, 2, IF(placeholder_with_twenty<=15, 3, IF(placeholder_with_twenty<=20, 4, 5))))

=> 4
placeholder_with_twenty is used as a variable with the default value 20. This allows formulas to be tested very well and clearly.

or a simple:
if(128>64,1,0) => 1

or you work with AND:

IF(AND(328>64, 328<=265), 1, 2) => 2

The input is 328 - if the input is bigger than 64 AND smaller than 265, you get 2.

Or with a boolean with true/false:

if(reprint= true and tool_cost="high",4,5) => 4


Formula Comments:

Formulas can also include comments to explain their purpose.

/*
This is a multi-line or single-line comment
*/

SWITCH(PageCount,8,80,16,160,/* Additional Info */ 200,2000,11111)

💬 Comments directly in formulas

In theory, you can also include comments directly within a formula.

This is helpful if you want to revisit certain values later or you’re still unsure whether a specific part of the logic or calculation is correct.


🛠️ More functions coming soon

We’re continuously expanding the Estimator.

Features like autocomplete and many other improvements are already planned.


❓ Got questions?

If you have any questions about the Estimator, feel free to contact our support team.

We’re happy to help!


📁 Example Excel file for a 3D LookupTable

You can find an example Excel file for a three-dimensional LookupTable [here].

It helps you understand the structure and setup.

Did this answer your question?