Pricing Formula Examples and Variables
  
Pricing Formula Examples and Variables
Pricing Formula Overview
A formula, in its simplest state, is an expression of one thing in relation to another thing. For example, if you are setting prices for the use of a particular location, the cost might be $10 per hour. An event that uses the location for three hours would cost $30.
However, in the real world, pricing is often more complicated. Perhaps certain hours are considered standard and others overtime, or your pricing may include extra charges, different rates for different types of customers, and so on.
In 25Live, you can create pricing formulas that are as simple or complex as you need. A formula can consist of a single expression, or a series of conditions (followed by question marks), with one or more expressions denoting how to calculate the price based on the answers to those questions.
Arithmetic operators
When writing formulas, you can use the following standard arithmetic operators:
*
multiplied by
/
divided by
+
plus
-
minus
%
percentage of
( )
signifies a discrete calculation within the parentheses
For example, if you have items which cost $10 each, you would write the formula for them as:
quantity * 10
The section “Pricing Formula Examples” shows you specific examples of how to use these symbols to write a formula that meets your needs.
Conditions
You can create more complex formulas by specifying conditions. When a condition is specified in a formula, the formula is used to calculate the price only if the condition is true.
For example:
ExpHeadCount > 100 ? 10 * OccurrenceDuration
will only apply the price (10 * OccurrenceDuration) when the expected head count of the event occurrence is more than 100.
The set of variables you use in your pricing formulas can also be used in conditions. The result of a condition must be true or false.
In addition to the arithmetic operators shown above, you can use these operators in conditions:.
>
greater than
>=
greater than or equal to
<
less than
<=
less than or equal to
=
equal to
!=
not equal to
You can also show logical relationships between items:
!
logical NOT
&
logical AND
|
logical OR
For example, if you want to set a condition that a formula is only to be applied when the expected head count is between 50 and 100, you would express that as:
ExpHeadCount > 50 & ExpHeadCount < 100 ?
Conversion functions
In the conditional part of a formula, you may need to convert data from one format to another to compare like items (for example, two dates or two times). 25Live recognizes the following conversion functions:
$datim
returns the date and time
4/27/2017 16:00
$date
returns the date
4/27/2017
$clock
returns the time, in 24-hour form
16:00
For example, to set a condition that a certain price should be used if the reservation ends after 9:00 p.m., you’d enter:
RsrvEndTime > $clock("21:00") ?
Extraction codes
When you are working with data stored as dates or times, you may want to extract information in a certain form so that it can be easily compared to other data. You do this with an extraction code. These are the extraction codes recognized by 25Live:
H
Hour (24-hour clock)
N
Minutes (Note: Uses the letter N, because M is used for Month)
A
Day of the week (1-7, Monday = 1)
D
Day of the month
M
Month number (1-12)
Y
Year (4 digits)
X
Fiscal year (4 digits)
W
Week number (1-53)
Note: This code places the first day of January within week 1 if it falls on Mon-Thurs, and within week 53 of the previous year if it falls on Fri-Sun.
Examples of conditions that use extraction codes:
RsrvStartDate[A] = 1
(Is reservation start day a Monday?)
RsrvEndDate[Y] = 2017
(Is reservation ending date in the year 2017?)
Advanced mathematical functions
You may want to use advanced mathematical functions for complex pricing formulas. The following functions are recognized by 25Live:
abs
Return the absolute value of X (|X|)
acos
Return the arc cosine of X
asin
Return the arc sine of X
atan
Return the absolute value of X
cos
Return the cosine of X
e
Return the value of e
exp
Return the exponential of X (ex)
exp10
Return the base 10 exponential of X (10x)
fact
Calculate the factorial of X (X!)
frac
Return the fractional part of X
int
Return the integer part of X
log
Return the natural logarithm of X (logeX)
log10
Return the base 10 logarithm of X (log10X)
pi
Return the value of pi
power
Calculate the value of X raised to the power of Y (Xy)
sin
Return the sine of X
sqrt
Calculate the square root of X
tan
Return the tangent of X
For example:
If the cost of chairs is $5 per 25 (1-25 chairs is $5.00, 26-50 is $10, and so on), your formula would be:
5*(int((Quantity-1)/25)+1)
Referencing existing formulas
To make it easier to create a new formula, you may want to refer to an existing formula and then make the needed adjustments. To do so, enclose the Rate Group in curly brackets. For example, if the Corporate rate is twice the Student Organizations rate, your formula for the Corporate rate would be:
2 * {Student Organizations}
This formula would use the formula for Student Organizations to calculate the rate (such as overtime, staff fees, and so on) and then double it.
If you reference a Rate Group that doesn’t exist (or doesn’t have a pricing formula associated with it), the part of your formula that references that group resolves to 0.
Referencing custom attributes
You can refer to a custom attribute in your pricing formula.
For example, if you have created a custom location attribute named SquareFootage, and you want to create a pricing formula where the price is determined by the square footage of the room, say $10 per square foot, your formula can refer to the attribute as follows:
10 * @SquareFootage@
If you have the same custom attribute name in multiple places, the pricing formula gives them precedence as follows:
First precedence: event custom attribute
Second precedence: organization custom attribute
Third precedence: location/resource custom attribute (these are only applicable when pricing a location or resource)
Note: If your custom attribute has locations in the name (for example, “Square Footage”) then you need to have the locations in your formula:

10 * @Square Footage@