|
Can someone please tell me why this formula will not allow a summary:
local NumberVar TotalPaid := 0; local numbervar theAmount := 0; local numbervar theRate := 0;
theAmount := {@CommissionableSalesPaid}; if {AR_Customer.UDF_INSIDE_REP}="DP" then theRate := .0085;
If {AR_Customer.UDF_INSIDE_REP}="KE" then TotalPaid := {@PaidFromKERate} + {#RTotal0}; If {AR_Customer.UDF_INSIDE_REP}="KE" and TotalPaid < 2000001 then theRate := .00125 Else if {AR_Customer.UDF_INSIDE_REP}="KE" and TotalPaid >= 2000001 and TotalPaid < 2300001 then theRate := .005 Else if {AR_Customer.UDF_INSIDE_REP}="KE" and TotalPaid >= 2300001 then theRate := .001; theAmount * theRate
It does produce a numerical value for every line in the report. {@PaidFromKERate} gets its value from a shared variable that is populated from a subreport in the report header of the main report, but even if I remove that, I still can't summarize on this field.
Thanks
|