I am looking to create a calculated field that will find the sum of fields on related records if they meet 2 separate conditions. I'm able to use the rollupConditionalSum to account for one of the conditions, but I can't figure out how to include an additional condition.
For my specific scenario we have a module for all our orders. Each of those order records have related individual transaction records that house specific components of the sale (i.e. a discount, fee, payment, etc.). I am looking to create a single field that will sum up all the same transaction types that have a specific status. We currently have this formula that isn't quite doing what we want:
ifElse(
equal(related($sp_transactions_ord_orders,"transaction_status"),"Applied"),rollupConditionalSum($sp_transactions_ord_orders,"transaction_amount","transaction_account_types","Applied_Payment"),0)
The problem with the above formula is that it is just looking for the presence of any related transaction with status of "applied" and then summing all transactions of type "applied_payment". What I need is for it to only sum all the transaction amounts for records that have the type of "applied_payment" AND transaction status of "Applied".
Any guidance you can offer would be greatly appreciated!
Thank you,
Abby