ggovedar Posted August 10, 2007 Share Posted August 10, 2007 I know the following is really to long, but please bear with me.... I’m developing a report with two groups Group 1 – brokerGroup2 – product It’s a YTD report so in the column header I have 200701, 200702, 200703… My date looks something like this Broker_name Month Product ValueBroker 1 2007January a 100Broker1 2007JFebruary b 50Broker1 2007JMarch b 50Broker2 2007January a 10Broker2 2007February a 10 I need to show sums by broker by product by month In product group footer I’ have a variable summing up all values by broker/product as thisVariable name sumJan new Double (($F{Month}.equals("2007January") ? $F{Value}.doubleValue() : 0.00 )) calculation type: sumrest type: groupreset group: product this all works fine and I get correct sum per broker/per product Broker Name Product 200701 200702 200703….Broker 1 a 100 0 0 b 0 50 50TOTAL 100 100 150Broker2 a 10 10 0TOTAL 10 20 0 The problem comes when I try and sum by product by month, the sums seem to be MULTIPLIED by what seems the position of declared sum variable..more or less So for broker 1 I’ll get 100 in the sum for 200702, and 150 for 200703 in this variable..the… multiplication number seems to go up for each month so for May it is what actuall sum for that month should be multiplied by 5…. Variable name: sum_sum_jan $V{sum_jan} calculation type: sumrest type: groupreset group: broker It seems to me like there is a loop that adds all the fields together an by the time it gets to for example May it has already added all the values 4 times, so I end up with the total 5 times more than it should be… I hope this makes sense..Anyone has any idea how can I stop this from happening?? Thanks in advance Goran Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now