---
schema_version: "1"
id: e6e341970f5eb812ebbcc57730936b92e792fc9334b158253775249ef5448942
title: Condition Hierarchies and Sets in Penny Perfect Pricing
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_concept_user_hierarchies_sets.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_concept_user_hierarchies_sets.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a2ac1b8176f3ef4998ce8da293e1f64c5ef16a7acd82b9aebf5bd2341e34374b
description: Penny perfect pricing is data-intensive. As numerous condition types are defined at the product level or customer level, storing all conditions in a mobile device is impossible. So the condition information is stored in more general levels, specifically Customer Hierarchy, Product Hierarchy, or Customer Sets.
products:
  - Consumer Goods
release: "264"
---
# Condition Hierarchies and Sets in Penny Perfect Pricing

Penny perfect pricing is data-intensive. As numerous condition types are defined at the product level or customer level, storing all conditions in a mobile device is impossible. So the condition information is stored in more general levels, specifically Customer Hierarchy, Product Hierarchy, or Customer Sets.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience in <strong>Professional</strong>, <strong>Enterprise</strong>, and <strong>Unlimited</strong> Editions that have Consumer Goods Cloud enabled</td></tr></tbody></table>

You can group by hierarchy nodes or by sets. If multiple conditions are available for a condition search that's using hierarchy search, information regarding each condition is stored in the calculation XML. Internally, the pricing engine merges these conditions into a single condition, which is then used for order calculation.

Condition Search Based on Sets and Hierarchies

During order calculation, the pricing engine performs one of these actions:

- Determines the conditions of a customer at a specific org level of the orderer's customer hierarchy (CP\_Search\_Strategy\_Step.Account\_Hierarchy\_Search = 'Customer Level 1 … 7')
- Considers all the customers in the hierarchy (CP\_Search\_Strategy\_Step.Account\_Hierarchy\_Search = Complete)

You get the flatten hierarchy data for your customers. The customer whose hierarchy data is required is always referenced in the lowest level in Flatten\_Account\_Hierarchy.Account\_Level\_15…01.

You get the object holding the org-level information data for the customers of the customer hierarchy from Flatten\_Account\_Hierarchy and the condition data from CP\_Advanced Pricing\_Condition of a customer.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_retail_admin-264-0-0-production-enus/5bb7d7f5-119d-42d0-8596-95e762837019/images/icon_note.png)

Note Using hierarchies or sets as search attributes in key types is performance-critical.

Customer Hierarchy

A device needs trade org hierarchy to determine the hierarchy if customer hierarchy search is used. For example, all stores of an account get a special discount of 5% per order.

Product Hierarchy

Logging in to the offline mobile app initializes the pricing engine. This initialization creates the database connection and the data readers asynchronously. During this initialization, the pricing engine creates a lookup structure for translating the product IDs of the order items into product PKeys. For example, all beverages get a special discount of 10%.

Customer Sets

After the pricing engine starts calculating the current order, the pricing engine determines all relevant customer sets of the current customer. For example, all customers who participate in a promotion get a special discount of 10%.