Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-30
3
Medium Priority
?
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 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 101

Expert Comment

by:mlmcc
ID: 18051094
Glad i could help

mlmcc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

730 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