Loading
Salesforce now sends email only from verified domains. Read More
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Use the Aggregate Price Element

          Use the Aggregate Price Element

          Aggregate and show the price of a group of products based on product categories, product types, or other groups of line items.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Unlimited, and Developer Editions of Revenue Cloud where Salesforce Pricing is enabled
          User Permissions Needed
          To create, update, and delete pricing procedures: Salesforce Pricing Design Time
          Important
          Important When using the Aggregate Price element, be careful not to create pricing loops by incorrectly mapping values in your pricing procedure. For instance, a circular dependency forms when the Net Unit Price is set by Input Unit Price, but then Input Unit Price is changed by an aggregate element that also relies on Net Unit Price. This creates a never-ending loop where Net Unit Price keeps updating, preventing it from settling on a final value and causing performance problems or wrong calculations.

          Let's look at a scenario where we group products by their category. We'll add three products: laptops, printers, and Quip software. Laptops and printers will be assigned to the Electronics category, while Quip's category will be Software. Using this data, we'll calculate the aggregate price for each product category.

          Note
          Note
          • In the Aggregate Price element, the Output and GroupBy tags must belong to the same hierarchical level within the context.
          • When you use the Aggregate Price element to calculate an average for the Currency data type, the average value can have up to 16 decimal places.
          1. Configure a pricing procedure.
          2. Click Add Element iconto add the Pricing Setting element and map these variables.
            • Input Variables
              • Line Item: LineItem
            • Output Variables
              • Price Waterfall: price_water_fall
              • Net Unit Price: NetUnitPrice.
              • Subtotal: ItemNetTotalPrice
          3. Add the List Price element to fetch the base price of the product.
            Under Lookup Table Details, select the Price Book Entries decision table and map these variables.
            • Input Rule Variables
              • Product: Product
              • Price Book: PriceBooks
              • Product Selling Model: ProductSellingModel
            • Input Variables
              • Quantity: LineItemQuantity
            • Output Variables
              • List Price: ListPrice
              • Subtotal: ItemNetTotalPrice
          4. Add the Aggregate Price element and specify these variable values.
            1. Group By: ProductCategory
              The Group By field sets your grouping criteria by searching for the criteria according to which the aggregation is performed.
            2. Formula: SUM (ItemNetTotalPrice)
              This is the aggregation formula used to calculate the pricing.
            3. Output Variable: ItemGroupSummarySubtotal
              The output variable contains the context tag that stores the output derived from the aggregation formula. Aggregate Price window
          5. To override the pricing output of a variable use the Write Back condition.
          6. Click Pricing Procedure Builder iconand select Include in Output.
          7. Finally, set your preferences to view pricing information, profile access, and rank information.
          8. Save your procedure.
          9. Click Simulate to test your procedure. Enter the input values for your products and click Simulate again.
            Aggregate pricing changes can't be viewed in the waterfall view. However, the JSON output provides insight into how the aggregate prices were calculated based on the product category. Based on our example, the aggregate price of products belonging to the Electronics category is calculated by summing their individual prices ($141,615 + $4,975), resulting in an ItemGroupSummarySubtotal of $146,590. This confirms that your procedure is working as expected.
            Aggregate Price waterfall view
           
          Loading
          Salesforce Help | Article