# Help with Calculation

## Recommended Posts

Hi All-

I am having trouble getting the Total of 'Rpt %' column.  The calcuation for 'Rpt %' column is based on two different variables and calculation is done directly on the TextField Expression. Here are the setup/calculation for both Net and Rpt % columns.

Net (for each row)

Name:  SalesQty_Total
Variable Class:  java.lang.float
Calculation:  SUM
Reset Type:  Group
Reset Group:  ID Group
Increment Type:  None
Increment Group:  blank
Variable Expression:  Float.parseFloat(\$F{SalesQty}) - Float.parseFloat(\$F{VoidsQty}) - Float.parseFloat(\$F{RefundsQty})

Net Totals:

Name:  SalesQty_TotalGrp
Variable Class:  java.lang.float
Calculation:  SUM
Reset Type:  Group
Reset Group:  Cat Group
Increment Type:  None
Increment Group:  blank
Variable Expression:  Float.parseFloat(\$F{SalesQty}) - Float.parseFloat(\$F{VoidsQty}) - Float.parseFloat(\$F{RefundsQty})

Rpt % (for each row)

Calculation is directly on the "Text Field Expression"

(\$V{SalesQty_Total}/\$V{SalesQty_TotalAll}) * 100

(SalesQty_Total / SalesQty_TotalAll) * 100
(3 / 271 ) * 100 = 1.11
(12 / 271) * 100 = 4.43
(21 / 271) * 100 = 7.75
(235 / 271) * 100 = 86.75

 Name Net Rpt % Pepsi 3 1.11 Dr Pepper 12 4.43 Iced Tea 21 7.75 Coke 235 86.75 Totals: 271 [Need Total]

So my question is:

1.  How do I get the Total of "Rpt %" column?

I can't seem to get the correct calculation and I have tried different setup.  Any help/suggestion is very much appreciated.

Thanks!

~a

• Replies 1
• Created

#### Popular Days

Created multiple variables to get Highest Totals and then applied the calculation directly to the text field.

{Group Highest Total / Report Overall Highest Total} * 100 = [%Rpt]