Good day,
We have an ask to add a derived field to a contract screen that calculates what our spend is on each contract over the past year. I can get it to sum all spend, but the sticking point seems to be limiting it to the last years' worth of activity. The code below is one of the iterations I've tried. Any help would be greatly appreciated!
Contract is a BusinessClass
owned by po
Derived Fields
RollingAnnualSpend is a DerivedField
type is Decimal size 12.2
if (ReleasedPurchaseOrderLineRel.CloseDate > (current date - 365))
return (sum ReleasedPurchaseOrderLineRel.ContractAmount)