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!

Net Change summary

Status
Not open for further replies.

kiwilamb

Technical User
Nov 17, 2005
4
CA
Hi there

I'm attempting to write a report where I have a running balance value field which I want to dissect and show the net amount for the value (today's value less yesterdays). I also have a field which is value type (say Actual and Budget but there are more than this) which means I can't apply a filter to the entire report. I need to be able to sum the value field to show the summary per day for each value type.
My method was to create if formulas for each value type;

if {Summary_data.summary_type}= 19028
then {Summary_data.value} /100
else 0

which I would then sum by date (this formula is missing the subtraction of yesterday's date). I have attempted using previous calculation but you can't sum that formula.

Any ideas would be great, I talked to someone and they thought it would need to be done outside of Crystal in a query.

Cheers
 
You can do running totals that use formulas, including formulas that refer to 'previous'. Or separately summing for 'yesterday' and 'today'. Does that help?


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
First group by {table.type} and then sort the records by {table.date}. Then create two formulas:

//{@reset} to be placed in the group header:
whileprintingrecords;
numbervar cnt := 0;

//{@currentday} to be placed in the detail section;
whileprintingrecords;
numbervar cnt := cnt + 1;

if cnt = 1 then
{Summary_data.value}/100 else
({summary_data.value}-previous({summary_data.value}))/100

Not sure why you are dividing by 100.

If you are really only looking for the difference between the first and last value per type, then create a formula:

maximum({summary_data.value},{table.type}) - minimum({summary_data.value},{table.type})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top