Solved

How to compare a value in the current row with a value in the previous row?

Posted on 2006-11-30
3
404 Views
Last Modified: 2008-02-01
Experts-

In my report, I want to report on the numeric difference between two values in order to show the delta. For example:

Month 1:  35 widgets   Delta: Unknown
Month 2:  15 widgets   Delta: -20
Month 3:  17 widgets   Delta: +2
Month 4:  22 widgets   Delta: +5

Can I create a formula in Crystal that will do this? (I suppose I need to store the previous row's widget count as a variable, so I can then compare it with the current row's count.) I also need to handle--as the example shows--the first row that won't have a previous row for comparison.

Thanks.
0
Comment
Question by:DataDesignIT
  • 2
3 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 18047451
Try this

Name - MyDelta
Formula
If (PreviousIsNull({YourQuantityField})) then
  "Unknown"
Else
  ToText({YourQuantityField} - Previous({YourQuantityField}),0)

mlmcc
0
 

Author Comment

by:DataDesignIT
ID: 18048249
Perfect! Just what I needed. Thanks.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18051094
Glad i could help

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now