Using logical expressions in formulas


Formules can contain a conditional expression of the form 'if - then' . In formula nomenclature, such expressions are described using square brackets: [Condition:Value] - if Condition is satisfied, then the formula should be given Value.
Conditional clauses can also be combined, e.g. [Cond1:Value1] [Cond2:Value2] [Cond3:Value3] Value4
- If Condition1, is met then Value1, is different:
- If Condition2 is met, then Value2 is different:
- If Condition3, is met then Value3, is different:
- If neither condition is met, Value4.
Primeri formuli:
Formula |
Description |
#MPRICE# * 0,75
|
Multiply the retail price by 0.75.
|
#PRFACTOR# * #PRURE#
|
Multiply the factor from the preparation of the accounts by the hours from the preparation of the accounts.
|
[#KOL# > 100:#MPCENA#*0,8] #MPCENA#
|
If the quantity is greater than 100, then the price is MPCENA - 20%, but if the condition is not met (i.e. the quantity is less than or equal to 100), then the price is MPCENA.
|
 |
WARNING
The logical operator 'greater than or equal to' or 'less than or equal to' is written with two successive conditions. For example: i term 'if A is greater than or equal to B, the value of the term is 0, otherwise 1' in the formula is written as: [A>B:0] [A=B:0] 1.
|