Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Finding a field w/ a formula Post Reply Post New Topic
Author Message
jcc0001
Newbie
Newbie


Joined: 05 Nov 2009
Online Status: Offline
Posts: 4
Quote jcc0001 Replybullet Topic: Finding a field w/ a formula
     Posted: 05 Nov 2009 at 10:45am
Hi,
 
I am new to CR but what I am trying to do seems simple.  I want to identify a text field and then back up one record to capture the previous text field.  After applying the formula below I receive the error "A number, currency amount, time or date-time is required here".
 
if {BAQReportResult.PartTran.TranQty} > 0 and {BAQReportResult.PartTran.BinNum} ="RECB" then {BAQReportResult.PartTran.BinNum} -1
 
Thanks for any help.
 
Chris
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2009 at 10:55am
if {BAQReportResult.PartTran.TranQty} > 0 and {BAQReportResult.PartTran.BinNum} ="RECB" then previous({BAQReportResult.PartTran.BinNum})
IP IP Logged
jcc0001
Newbie
Newbie


Joined: 05 Nov 2009
Online Status: Offline
Posts: 4
Quote jcc0001 Replybullet Posted: 05 Nov 2009 at 12:08pm

Thanks!!  That worked great.

Now that I can get the previous field another issue occurs in the report.  Because of the formula I am using there is a lot of unnecessary filler data making the report about 35 pages when I only need about 2 pages.  So I sort by another field (time) to nicely group the data I am after but that breaks my "previous" formula because another field entry is the new "previous".  If there was someway to "freeze" the report before sorting would be nice.  Or I'm sure there is a neat trick to blow away the filler data but I haven't figured that out yet.
 
Thanks
 
Chris
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2009 at 12:17pm
Define your "filler" data (based on row level information) and then conditionally suppress the rows based on those rules.
I am guessing that you want to only show the records met the "previous formula" rule.
Go into the select expert
select details
click on the Suppress (No Drill Down) formula box
add in a formula that when it returns TRUE then this row is suppressed e.g.
NOT ({BAQReportResult.PartTran.TranQty} > 0 and {BAQReportResult.PartTran.BinNum} ="RECB")
 


Edited by DBlank - 05 Nov 2009 at 12:18pm
IP IP Logged
jcc0001
Newbie
Newbie


Joined: 05 Nov 2009
Online Status: Offline
Posts: 4
Quote jcc0001 Replybullet Posted: 05 Nov 2009 at 1:46pm
Thanks for info.  Unfortunately I could not find "Details" or "Supress" in Select Expert.  I'm sure it is something I am overlooking. 
 
The problem with the report is the quantity column is returning the value 0 if the condition below is not met (I am trying to eliminate the negative numbers).

{BAQReportResult.PartTran.TranQty} > 0 and {BAQReportResult.PartTran.BinNum} ="RECB" then {BAQReportResult.PartTran.TranQty}

These zeroes are what I call "filler" data.  So I tried an Else statement to report back blank but I receive an error because a number is required.  Among them I tried below to no avail.
 
Else = ""
Else null
Else ""
 
I can try the Supress option with some more help or maybe I could email the report and results for a better look at what I am dealing with.
 
thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2009 at 2:08pm
OOPS! Embarrassed
I meant Section Expert not Select Expert.
 
IP IP Logged
jcc0001
Newbie
Newbie


Joined: 05 Nov 2009
Online Status: Offline
Posts: 4
Quote jcc0001 Replybullet Posted: 05 Nov 2009 at 2:31pm
Awesome!! That was it.  Worked like a dream.
 
thanks.
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