Jump to content
We've recently updated our Privacy Statement, available here ×

Problem on Summation by Group


arceliza

Recommended Posts

Re: Summation by group

Here’s the scenario:

 

Items A B C D E F G

Group1

I1 1 2 4 2 0.10 2.00 0.20

I2 2 2 4 4 0.20 2.00 0.40

Totals 8 6 0.60

 

Group2

I3 3 2 2 6 0.30 1.00 0.30

I4 4 2 1 8 0.40 0.50 0.20

Totals 3 14 0.50

 

 

Given:

A, B & C

 

 

Computation:

D = A * B

E = D / SUM [D]

F = C / B

 

G = E * F

= new Double(

(($F{A}.doubleValue() * $F{B}.doubleValue()) / $V{SUM_G}.doubleValue()

)

 

The summation for C & D didn't have a problem since I directly get the fields. I had a problem getting the summation for G per group since it involves computation with summation of overall totals for D. It gives a different result. I added a new variable (SUM_G) which has a class type of java.lang.Double and calculation type is Sum. Its reset type is Group and the reset group is the group I added. Does it have something to do with the evaluation time of the variable? How can I get the correct result? Thanks

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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...