For example, you could enter the formula in the price component like this:
(LOOKUP("DEINE-LookUp-Table_ID", Auflage, Seitenzahl, Maschinentyp)*100)*Auflage
If you want the lookup table to return a default value when no matching value exists, you can use this:
(LOOKUP_WITH_DEFAULT("DEINE-LookUp-Table_ID", 1000, Auflage, Seitenzahl, Maschinentyp)*100)*AuflageThis returns 1000 if the lookup table contains no value for the parameters entered. Instead of 1000, you can also use a more complex calculation or another formula.
You can use a wide range of functions and variables, such as:
if, not, min, max, sum, and round
The following basic mathematical functions are available:
<, >, <=, >=, <>, !=, =,
IF, AND, OR, XOR, NOT, SWITCH, MIN, MAX, SUM, AVG, COUNT, ROUND, ROUNDDOWN, ROUNDUP, ABS, INTERCEPT
Here are some common examples:
Return minimum or maximum values:
Max(10,9,8,7) => 10
Min(10,9,8,7) => 7
Here are some rounding examples:
Round(8.3) => 8
Round(8.5463,2) => 8.55 (the second value sets the number of decimal places to round to
Rounddown(55.55) => 55
Roundup(55.55) => 56
Round(Seitenanzahl/2)*2 => can help ensure you always calculate with an even number
A Rangeswitch function could look like this:
RANGESWITCH(Seitenanzahl,1,64,64,65,128,128,129,240,240,241,300,300,11111)
If the page count is 1 to 64, the return value is 64; for 65 to 128, the return value is 128, and so on.
A Switch function checks for a specific value rather than a range:
SWITCH(Seitenanzahl,8,80,16,160,200,2000,11111)
If the page count is 8 , the return value is 80; for a page count of 200, it returns 2000. If no value matches, the fallback value is always 11111
Alternatively, you can 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 a variable with a default value of 20. This is a handy way to test formulas clearly.
Or just a very simple if function:
if(128>64,1,0) => 1
You can also include a Boolean with true/false:
if(Nachdruck= true and Werkzeugkosten="mittel",4,5) => 4
Alternatively, you can use AND, for example:
IF(AND(328>64, 328<=265), 1, 2) => 2
The input here is 328. If the input is greater than 64 AND less than 265, you get 2 back.
Use CONCAT to build a string from several values:
CONCAT(Produktbreite, "x", Produkthöhe) => "210x297"
You can also use a calculation from another price component:
You can find the price component URL in the address bar.
PREVIOUS_RESULT('Deine-Pricecomponent-ID', 'internal_costs')
You can also specify total_costs, external_costs, labor_costs and material_costs.
You can also add comments to formulas. This can help explain what happens in the calculation:
/*
Dies ist ein mehrzeiliger oder auch nur einzeiliger Kommentar
*/
SWITCH(Seitenanzahl,8,80,16,160,/* hier kann man auch Infos in eine Formel schreiben */ 200,2000,11111)
You can also add comments directly within a formula. This can be useful if you want to check individual values later, or are not yet sure whether a value or calculation is correct at that point.
More functions will be added.
Autocomplete is also planned, along with much more.
If you have any questions about the Estimator, feel free to contact us.
