Adjusting Total Value Formula

Hi, 

I wanted to ask, if anyone knows how to adjust the total value formula (standard opportunity field):

ifElse(and(isNumeric($quantity), isNumeric($discount_price)),
ifElse(equal($quantity, 0),
$total_amount,
currencySubtract(
ifElse(isNumeric($subtotal), $subtotal, multiply($discount_price, $quantity)),
ifElse(equal($discount_select, "1"),
currencyMultiply(
ifElse(isNumeric($subtotal), $subtotal, multiply($discount_price, $quantity)),
currencyDivide($discount_amount, 100)
),
ifElse(greaterThan($quantity, 0),
ifElse(isNumeric(toString($discount_amount)),
ifElse(greaterThan(0, $discount_price),
negate($discount_amount), $discount_amount
), 0
),
ifElse(isNumeric(toString($discount_amount)), negate($discount_amount), 0))
)
)
), ""
)

My goal is to add two new conditions, as I want it to not only sum the $discount_amount, but data from two additional fields?

Best, 

Ada

Parents
  • Hi ,

    The formula you cite is used in the total_amount field in Revenue Line Items, not Opportunities. To edit that formula, you can modify it directly in Studio when modifying the total_amount field. 

    Chris

  • Hi

    Yes you are right - my mistake. 

    My Total Contract Value opp field formula is: 

    add(rollupConditionalSum($revenuelineitems,"total_amount","sales_stage",forecastSalesStages(true,false)),related($revenuelineitems,"ps_price_c")) 

    Unfortunately, the PS_Price_C (from revenue line item) is not being summed to TCV - I am not sure what I am doing wrong? 

    Thanks!

  • Hi ,

    Can you share a screenshot of your ps_price_c field in Studio? It's difficult to ascertain why the value may not be included based on the formula alone, so seeing how the field is configured would help in troubleshooting the issue. 

    Chris

  • Hi ,

    I am having difficulties attaching a screenshot at the moment. 

    It's a standard currency field with no calculated formula. 

    I actually updated the formula to: 

    add(rollupConditionalSum($revenuelineitems,"total_amount","sales_stage",forecastSalesStages(true,false)),related($revenuelineitems,"non_arr_fee_c"),related($revenuelineitems,"ps_price_c"))

    Surprisingly, The non_arr_fee_c field is working fine and is being summed to Total Contract Value field on the opportunity...

Reply
  • Hi ,

    I am having difficulties attaching a screenshot at the moment. 

    It's a standard currency field with no calculated formula. 

    I actually updated the formula to: 

    add(rollupConditionalSum($revenuelineitems,"total_amount","sales_stage",forecastSalesStages(true,false)),related($revenuelineitems,"non_arr_fee_c"),related($revenuelineitems,"ps_price_c"))

    Surprisingly, The non_arr_fee_c field is working fine and is being summed to Total Contract Value field on the opportunity...

Children
No Data