Jump to content
Changes to the Jaspersoft community edition download ×

Help with Calculation


alfie1109

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

NameNetRpt %
Pepsi31.11
Dr Pepper124.43
Iced Tea217.75
Coke23586.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
 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...