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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summary of operation result

Status
Not open for further replies.

thebigbadwolf

Programmer
Jul 7, 2010
67
CY
Hello! I need to summarize the operation results. e.g the difference between two values and crystal not allow me to do it.
Is there a way to do it manualy?

Thank you
 
You need to give more info.

If you want to get the difference of two summaries use a formula

@Diff

Sum(valuefield1, groupfield) - sum(valuefield2, groupfield)

Ian
 
I want to get the summary of three differences
e.g.

number1-number2=number3

I need to have sum(number3)

Thanks for your prompt answer
 
If number 1 and 2 are sumaries then you will need to use a var.

If they are just fields creat a formula and then perform a sum summary on the formula.

For a variable

@sumDiff

whileprintingrecords;

global numbervar sumdiff;

sumdiff:=sumdiff+number1-number2;

Place this in group footer where number1 are evaluated number2 (when you know it works you can suppress formula so its invisible.

Place this in report footer
@display

whileprintingrecords;

global numbervar sumdiff;

Ian



 
Thank you very much. It is working.

Can we somehow reset sumdiff at the end of the group?
 
Yes

in group Header

@reset
whileprintingrecords;]
global numbervar sumdiff:=0;

Ian
 
when I put this @reset to group header, the summary reseted on every line in the group, so I only took every time last "number3" as summary.
This is happening even if I put @reset to page or to report header
 
sorry, I forgot to put @display in the report. So now it seems working.

Thank you
 
Also if you have repeat group header on each page it will reset.

you can use

not inrepeatedgroupheader;

At satrt of reset to prevent that ocurring

Ian
 
Now we have the summary working (number3). This value can be used in a graph. But when we are trying to calculate this value (e.g. number3/2) the result is not recognized in the graph. Why?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top