Conditional Sum Script Emulation

Discussion created by tleitzke on Apr 25, 2017
Latest reply on Apr 26, 2017 by philmodjunk

I need to 2 different sums of the same field, separated by a field that has "Yes" or "No". I couldn't find a way to do it with just a calculation, so I went to do it the hard way with scripts. It goes to a blank layout, performs find (where "bid ID == $Bid Id", and "Is Manufacturer Rebate = Yes"(or "No")). The script did not produce the right numbers. I have (many times over) checked that the previous fields are working correctly and producing the right numbers, so it is just this script that is bad.


(Totals table contains all my math. Yes, "Total Round X" is a bad naming scheme, when seen as just text)

(ALL Credits table contains all the credits)

(Credits table contains all the credits added to bid).


I have to separately do a sum for manufacture rebate and non; because the manufacture rebate applies to the final cost as it comes instantly from manufacturer- while the non-manufacture rebates do not come right away and can take many weeks to arrive (4-6) and doesn't apply to the final cost.



(I am honestly unsure if Sum applies to only found records or all)