Skip to Content
0
Former Member
Dec 05, 2008 at 04:46 PM

Percentage calculation and zero amount entries get dvision by zero error

49 Views

Hello, i am calculating the total of a field and then reporting the contributions of that line entry in percentage form but when a line has a zero amount i get an error of 'division by zero'. I'll give some explamples below incase i'm not explaining very well. If you replace the 225 under amount with 0 that is when i get the error.

code sample..

WhilePrintingRecords;
numbervar n := {@Total Weight}% Sum ({@Total Weight}, {JSALES_REPORT.SOPNUMBE});

data sample...

Amount % of total

150 40%

225 60%

(375)