Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have answered some questions and have gotten answers for my questions. Anywhere you can do this on one page helps tremendously..."

Geography

Where in the world do Tek-Tips members come from?
grecon (TechnicalUser)
16 May 12 13:08
Hi I have a cross tab that has the months (@monthnames) of the year as the row and the years(ORDER_DT) as the columns for sales figures (SUM of ORDER_TOT), now I want to show the difference for each month/year - for example:
2011 2012 Difference
January 50000 35000 -15000
Feb 75000 85000 10000
March 100000 165000 65000

I can't figure out what formula to use to get the difference between the two??? How do I get it to show the difference???? Thanks
Madawc (Programmer)
17 May 12 5:57
I don't think you can. Accumulate the totals separately, using a Mock-Crosstab. (Use SEARCh for details.)

yinyang Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP yinyang

lbass (TechnicalUser)
19 May 12 10:05
You can do this, but it would be just as easy to create a manual crosstab in this case. You would group on monthname and then add conditional formulas, one for each year:

//{@lastyear} for the detail section:
if year({table.date})=year(currentdate)-1 then
{table.amt}

//{@thisyear} for the detail section:
if year({table.date})=year(currentdate) then
{table.amt}

Insert sums on these at the group footer and then create another formula for the group footer:

//{@diff}:
sum({@thisyear},{@monthname})-sum({@lastyear},{@monthname})

Drag the groupname into the group footer and suppress the details and group header.

-LB
crystalkiwibruce (Programmer)
20 May 12 21:49
It depends on what crystal version you have.

With Crystal 2008/11 you can use an embedded summary to pick up the summary in this cell and then one in the previous row. and then subtract them.

Examples of how to use this is in the training database and report files on my web site. That's a free download with som

Bruce Ferguson
www.crystalkiwi.com/nlog.htm

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close