Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: 1st negative date Post Reply Post New Topic
Author Message
marcodutchb
Newbie
Newbie


Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 2
Quote marcodutchb Replybullet Topic: 1st negative date
    Posted: 12 Nov 2007 at 11:23am

newbie question ( I think) -

I have a column that basically holds a running balance by day of materials available. It some times happens that this balance goes negative. What I want to do is pull only the date when it first went negative and show that
date in the material group header.
 
How can I make this happen the easiest?
 
Thanks in advance!
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 14 Nov 2007 at 10:52am
If you are using running totals in your report, you may be out of luck.  It would take some fancy footwork to jigger a group operation based on a running total.

If, however, your running balance is stored in your data source, then it's actually quite easy.  You need a conditional minimum.  Create a new formula.  The formula should look something like:

Minimum ({BalanceDate},{CurrentBalance},"< 0")

What this formula does is look at all the dates where the balance is less than zero, and pick the earliest one.

Then, just add this formula to your group header, and you should be good to go!
IP IP Logged
marcodutchb
Newbie
Newbie


Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 2
Quote marcodutchb Replybullet Posted: 14 Nov 2007 at 11:09am
Thanks! yes it was a running total. If anyone is interested here is
the resolution:
 
Create a variable

In product header add formula (and suppress so not visible)

whileprintingrecords;

global datevar NegDate:=date(1900,01,01);
// This just rests dates date for each product

In detail add a formula

whileprintingrecords;

global datevar NegDate;
If Negdate= date(1900,01,01) and #RT Balance < 0 then
Negdate:= datefield;
// By testing for reset stops date being over written by subsequent dates when balance is still negative. YOu will need to creat a running total for balance which is reset on each change of Product group.

In group footer add formula

whileprintingrecords;

global datevar NegDate;

And that worked perfectly.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.