---
schema_version: "1"
id: dc6fe9279b9beeb8b0e14deb044dee17bb2373ed6e9075ac21347a6db7db8bda
title: Write Back Revenue Measure Values
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/aaf_customize_dpe_revenue_metrics_definition_writeback.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.aaf_customize_dpe_revenue_metrics_definition_writeback.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b4b5620a1ca6e0fe2c41b2ccdd63ee5deeb47260facc8fef9ebe9d7e7038a177
description: To write back data for the custom revenue measures that demand planners want to view on the forecast grid, update the appropriate nodes. The data is written back to the Advanced Account Forecast Fact object.
products:
  - Manufacturing
release: "264"
---
# Write Back Revenue Measure Values

To write back data for the custom revenue measures that demand planners want to view on the forecast grid, update the appropriate nodes. The data is written back to the Advanced Account Forecast Fact object.

### 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</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d11602e69">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d11602e69 ">To edit a DPE definition:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d11602e69 ">
              <ul>
                <li>Customize Application</li>

                <li>Modify All Data</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

This example walks you through aggregating the values for the computed variable cost and fixed cost across sales agreements, opportunities, and orders. You also define a formula to compute the final cost per unit of a product for a single period. Finally, the values for fixed cost and cost per unit are written back to the target object, Advanced Account Forecast Fact.

1. Update a group and aggregate node to add two aggregate records for computed fixed and variable cost.
    1. Search for and select the **Aggregate Account Forecast Fact Records To Eliminate Duplicates** group and aggregate node.
    2. Click **Add Aggregate** and enter these details.
        
        Alias: CumulativeTotalVariableCost
        
        Function: **Sum**
        
        Aggregate Field: ComputedTotalVariableCost
    3. Click **Done** and **Done**.
    4. Click **Add Aggregate** again and enter these details.
        
        Alias: MaxFixedCost
        
        Function: **Max**
        
        Aggregate Field: ComputedFixedCost
    5. Click **Done** and **Done**.
2. Update a join node to add the cumulative aggregated fields in all join nodes that follow the Aggregate Account Forecast Fact Records To Eliminate Duplicates node.
    
    ![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-manufacturing-264-0-0-production-enus/71a7997a-6330-43f9-81ad-0e7c8f13997c/images/icon_tip.png)
    
    Tip To find the nodes that you need to update, you can follow the reference links provided at the bottom of a node’s detail page in the sentence “This node is referenced by # node.” Or you can search for the node name.
    
    1. Search for and select the **Generated Account Forecast Facts Join Active Products** join node
    2. In the First Node section, click **Selected Fields**.
    3. Add **CumulativeTotalVariableCost** and **MaxFixedCost** as fields and then click **Done**.
    4. For the Generated Account Forecast Facts Join Periods, the Generated Account Forecast Facts Join Filtered Accounts, and the Generated Account Forecast Facts Join Existing Account Forecast Facts join nodes, repeat the steps to add the **CumulativeTotalVariableCost** and **MaxFixedCost** fields.
3. Create a formula node to calculate the final cost per unit of a product and link it to another node.
    1. Click **New Node** and enter these details.
        
        Node Type: **Formula**
        
        Name: Compute Revenue Metrics
    2. Save your changes.
    3. For Source Node, search for and select **Advanced Account Forecast Fact**.
    4. Enter these formula details.
        
        Alias: CostPerUnit
        
        Field Type: **Number**
        
        Number Length: 16
        
        Decimal Places: 2
        
        Formula: `IF({CumulativeOpportunityQuantity}==0, IF({CumulativeSalesAgreementQuantity}==0, 0, {CumulativeTotalVariableCost}/{CumulativeSalesAgreementQuantity}), {CumulativeTotalVariableCost}/({CumulativeOpportunityQuantity} + {CumulativeSalesAgreementQuantity}))`
    5. Click **Done** and **Done**.
    6. Search for and select the **Compute IsActive Attribute On Account Forecast Fact** formula node.
    7. Update the source node to **Compute Revenue Metrics**.
    8. Click **Done** and **Done**.
4. Update a writeback node with values to forecast fact records.
    1. Search for and select the **Upsert Account Forecast Fact Record** writeback node.
    2. Click **Add Row** and enter these details.
        
        Source Node Field: **MaxFixedCost**
        
        Target Field: **FixedCost\_c**
    3. Click **Add Row** and enter these details.
        
        Source Node Field: **CostPerUnit**
        
        Target Field: **CostPerUnit\_c**
    4. Click **Done** and **Done**.