Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum is getting doubled!

Status
Not open for further replies.

crystalreport85

Programmer
Sep 27, 2010
51
CA
This is my layout of my report

Group by Location
Grp by itemid
grp by tagno
displayed fields {table.physical_qty} and {table.computer_calculated qty}

in grp footer of tagno i display {table.physical_qty} and {table.computer_calculated qty}. I want to suppress the grp if the sum of {table.physical_qty} by itm_id is equal to {table.computer_calculated qty}

I created a formula to sum the {table.physical_qty} by itm_id. Problem is sum is getting doubled.I wonder why and what is the mistake I am doing.
 
what are the contents of the formula you use to calculate the sum?


I do not know if this will help, but...if you are using variables and have the 'sum-er' formula in the details, you will need a display formula to put in the footer which will be only the variable used in the 'sum-er' formula
ie: if your 'sum-er' formula is like this:
//{@SumIt}
whileprintingrecords;
numbervar sx;
IF itm_id=previous(itm_id) then sx := sx + {table.physical_qty} else sx := sx;
//{@SumDisp}
whileprintingrecords;
numbervar sx;
sx

 
You should some sample data for a couple of tagnos.

-LB
 

hi fisheromacse,
The formula(crystal report sum) says
@sum
sum({table.physical_qty},{table.itemid})
It should work but it is returning double the value for example: 20 it prints 40.
hi lbass,

My report data look like this

itemid aaa
tagno physical_qty computer
1000 100 250
itemid aaa
tagno physical_qty computer
1001 100 250
1002 50 250

if the total of physical_qty(250) is equal to computer qty ,tag grp section should not be displayed.

I hope I have explained clearly.
Thanks
 
Well, I meant for you to show detail level records with no suppression. When you show the sample, you should also show the results you are getting and the results you expect. I can't tell from what you are showing what incorrect result you are seeing, and I'm guessing you are showing a tagno group section, not the detail section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top