Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Stop formula when another field changes Post Reply Post New Topic
Author Message
BatteryMan
Newbie
Newbie
Avatar

Joined: 28 Jun 2012
Online Status: Offline
Posts: 4
Quote BatteryMan Replybullet Topic: Stop formula when another field changes
     Posted: 28 Jun 2012 at 3:15pm
Hi everyone. I've been using CR for about 2 weeks now and loving it, but I've run into a problem.

I'm creating a report from an SQL database to track warehouse picking productivity. There are two fields in question, we'll call them Time and User. I've figured out the formula to calculate the gap time between picks, that is the gap between lines in the Time field. See this example:

Time   User   Gap
1:15   1      
1:20   1      :05
1:25   1      :05
3:00   2      1:35
3:05   2      :05

As you can see, when changing from user 1 to 2, the formula still finds the difference between their pick times. How can I stop this?

Thanks in advance for any help given!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Jun 2012 at 3:56am
Try something like this:
 
If {table.user} = previous({table.user}) then (gap calculation)
 
This will set it up so that the calculation only occurs when the user for the current record is the same as the user for the previous record.
 
-Dell
IP IP Logged
BatteryMan
Newbie
Newbie
Avatar

Joined: 28 Jun 2012
Online Status: Offline
Posts: 4
Quote BatteryMan Replybullet Posted: 29 Jun 2012 at 10:52am
Incredibly simple - I can't believe I didn't figure it out!

Thanks a ton!
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum