Salesforce CPQ: Summary Variable

May 6, 2024

banner image

After completing this unit, you will be able to:

1. What is a Summary Variable?

2. How to use Summary Variable?

What is a Summary Variable?

Summary Variable allows you to perform mathematical operations on collected values from a number of fields associated with various records, like quote lines, product options, subscriptions, or assets. Here's how they work:

1. Mathematical Operations: You can define mathematical functions like sum, average, count, minimum, or maximum on the values of number fields. For instance, you can sum up the prices of all quote line items, calculate the average discount percentage, count the number of units sold, or find the maximum value of a particular field across all records.

2. Scope: Summary Variables can be scoped to specific records by applying filters. These filters ensure that the summary variable evaluates only the fields on records that match the specified filter criteria. For example, you can create a summary variable that sums up the prices of only quote line items with a specific product category or belonging to a particular sales region.

3. Usage: Once defined, summary variables can be referenced in various parts of the Salesforce CPQ environment. You can use them in quotes, quote line fields, and product rules to drive pricing, discounts, or other business logic based on the calculated summary values.

4. Dynamic Evaluation: Summary Variables dynamically recalculate their values as changes occur to the underlying records. This ensures that the summary information remains accurate and reflects the latest data entered into the system.

Overall, Summary Variable Fields provide a powerful mechanism for performing calculations and aggregations on numerical data within Salesforce CPQ, enabling organizations to derive valuable insights and automate pricing and quoting processes effectively.

How to use Summary Variable?

Create a Bundle Product

1. For creating a product, search Products in the App Launcher and select it.

2. Click on the New button and fill in these fields:

FieldValue
Product NameMouse
Product CodeMOUSE
ActiveTrue

3. Click Save.

image1

4. Now click on the Related tab, then go to Price Books, click on Add Standard Price, and fill out all the below fields:

FieldValue
List Price2000
ActiveTrue

5. Click Save.

image2

6. Similarly, you can create one more product with the following fields:

FieldValue
Product NameKeyboard
Product CodeKEYBOARD
ActiveTrue

image3

and create price books with the following fields:

FieldValue
List Price3000
ActiveTrue

image4

7. Similarly, create a new bundle product with the following fields:

FieldValue
Product NameHardware
Product CodeHARDWARE
ActiveTrue
Configuration TypeAllowed
Configuration EventAlways

image5    image6

and create price Books with the following fields:

FieldValue
List Price4000
ActiveTrue

image7

8. Now, in the Related tab of the hardware product, go to Options, then click on New to create two product options by filling in these fields:

FieldsOption1Option2
Number12
Optional SKUMouseKeyboard
Quantity EditableTrueTrue
BundledTrueTrue

9. Click Save.

image8

image9

Create Summary Variables

7. Search Summary Variables in the App Launcher and select it.

8. Create two summary variables by clicking on the New button and filling in these fields:

FieldsSummary Variable 1Summary Variable 2
Variable NameMouse QuantityKeyboard Quantity
Aggregate FunctionSumSum
Target ObjectProduct OptionProduct Option
Aggregate FieldQuantityQuantity
Filter FieldProduct CodeProduct Code
Operatorequalsequals
Filter ValueMOUSEKEYBOARD

9. Click Save.

image10

image11

Create Product Rules

10. Search for Product Rules in the app launcher and select it.

11. Click on the New button and fill in these fields:

FieldValue
Product Rule NameMouse Quantity Must be More than Keyboard Quantity
TypeValidation
Conditions MetAll
ActiveTrue
MessageMouse Quantity Must be More than Keyboard Quantity
ScopeProduct
Evaluation EventAlways

12. Click Save

image12

13. Now click on the Related tab, then go to Error Conditions, click on New, and fill out all the below fields:

FieldValue
Tested ObjectProduct Option
Tested VariableMouse Quantity
Operatorless than
Filter TypeVariable
Filter VariableKeyboard Quantity

14. Click Save.

image13

image14

15. Now, go to Configuration Rules, click on New, and fill out all the below fields:

FieldValue
ActiveTrue
ProductHardware

16. Click Save.

image15

To Test This:

1. Search for quotes in the app launcher and select it.

2. Click on New, then Save.

3. Click on the down arrow and select Edit Lines.

4. Click on Add Products and add Hardware.

5. Select both mouse and keyboard, and if you increase the keyboard quantity more than the mouse quantity, then an error message will be shown when you click on apply rules.

image17

Free Consultation