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!

How to calculate volume difference vertically?

Status
Not open for further replies.

breixo

MIS
Feb 6, 2006
16
IE
Hi,

I have to calculate the variation in terms of revenue month on month so the report should look like this:

Month Revenue Variation
Jan 100
Feb 80 -20%
Mar 70 -12.5%
Apr 90 +22%
May 110 +18%
Jun 130 +15%

Anyone know how to achieve this in Crystal please?

Much appreciated!!

 
Group by month, do group totals, monthly totals and percentages. Both summary totals and running totals include percentage values. (If you're not already familiar with Crystal totals, the basics are explained at FAQ767-6524.)

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Please clarify whether your display is at the detail or group level, i.e., are the volumes per month a summary or a field value?

-LB
 
Thanks for you replys first of all!

I use CR 10 and WinXP.

Info is displayed at the group level (month).

What I'm trying to achieve is what follows:

Revenue in January is 100, revenue in Feb is 80 so beside Feb and 80 I need to create a formula the displays a field that contains the variation between 100 and 80 which is -20%.
 
Create a formula {@change%}:

whileprintingrecords;
numbervar prev;
numbervar sumamt := sum({table.revenue},{table.date},"monthly");
numbervar change;

if groupnumber = 1 then
change := 0 else
change := (sumamt-prev)%prev;
prev := sumamt;
change

Place this in the group header and click on the percent icon in the toolbar.

-LB

 
It worked perfectly LB

Thanks a million!!

Much appreciated!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top