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

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions
User Permissions Needed
To edit a DPE definition:
  • Customize Application
  • Modify All Data

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
    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.