
The Formula Builder in SAP CPQ is used to bring automation and accuracy to configuring product offerings, calculating complex pricing, creating tags, creating expressions, and so on.
An expression in CPQ is a combination of values, variables, operators, and functions used to produce a specific result. Expressions are the building blocks of formulas, created to automate calculations or set specific conditions during the CPQ quotation process.
A tag is used in a formula to establish dynamic pricing rules as it represents the unit price and quantity of each item.
The Formula Builder window is divided into two main sections. The top section contains drop-down fields used to build the formula. The frame at the bottom, labeled Formula, is where you form the expression, either manually or by selecting the elements provided in the top section.
The Formula Builder is accessed wherever a formula expression can be used. To build a formula, select the kind of data (attribute, value, sequence, or complex tag) you want displayed. Then, provide the specifics, such as an attribute, sequence, or the complex tag's body. The top section includes operators and context-sensitive options, which are further divided into three tabs: Variables, Sequences, andActions/Conditions.
Hint
The Check Syntax button checks the formula to ensure that the tags have been properly assembled. Any errors are displayed at the bottom of the window. It's a good practice to check a formula by using Check Syntax before use to help ensure its proper formation. When finished, select the Update button on the bottom to insert the created formula into the property being edited.

Formula Builder allows you to insert a conditional or Boolean logic statement into a formula from the Select Operator drop-down field. Select an operator from the field and select the update button to include it in the formula. In most cases, the operator is added using its full syntax, including all necessary parentheses. The user then fills in the parameters.

In the Formula Builder under the Variables tab, begin creating a formula by selecting an action/condition/variable. Then select Attributes from the options.
Attribute values can also be selected for the formula if necessary. Attribute value code, attribute cost or price, and attribute quantity are examples of attribute variables.
Select the Insert Variable button to add the new tag to the formula.
Attributes can include the following values and variables:
Attribute Values
- Attribute Values:
- Create formula by selecting an Action, Condition or Variable.
- Select Attribute and Attribute Value.
- Insert Variable to add new tag to formula.
- Examples of Attribute Variables:
- Attribute Value Code.
- Attribute Cost or Price.
- Attribute Quantity.

The next tab in Formula Builder is Sequences, which provides serialization to part numbers. Sequences can also be used in a formula. Under the Select Sequence Operator menu, select the operator to include in the sequence. Then select the sequence from the Select Sequence menu. Select the Insert Sequence button to add the new tag to the formula expression.
The attributes, which display in the box, are limited to those selected for the associated product or category. If a certain object or attribute isn't available, make sure that it has been selected, check its syntax, or created for the intended formula expression settings.