Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1916
  • Last Modified:

Business Objects, Crystal Reports, 11 (XI)

I am familiar with the Previous() command and PreviousValue() commands in Crystal but i need to refer to a formula field in the previous record. They will not allow me to do this and give me the error "this field has no previous or next value" ... How do i do this?
0
Tom_cfglending
Asked:
Tom_cfglending
  • 5
  • 2
  • 2
  • +1
2 Solutions
 
peter57rCommented:
Are you sure this is not just a 'first record' problem (There is no previous record if you are on the first record).

Use

 If not Onfirstrecord then
//your current formula
else
// do nothing

0
 
Tom_cfglendingAuthor Commented:
No. I put this in:

If not Onfirstrecord then
Previous({@To Return})
else
0

and it gave me the same error
0
 
peter57rCommented:
Then you will have to post your formula code.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Tom_cfglendingAuthor Commented:
So there is no way to call a previous formula field?
0
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Post your formula ({@To Return}) expression.

It's probably a WhilePrintingRecords; formula or a formula with some aggregate function.
Such formulas are not candidates for a Previous() function.

- Ido
0
 
Tom_cfglendingAuthor Commented:

This is {@To Return}
{@MidBalance}+{@Draw 2 Live}

This is {@MidBalance}
if {Draws_Payable.Draw Amt}-{Final_Pd_Comission_Totals.SumOfSumOfCommission Rec}>0 then {Draws_Payable.Draw Amt}-{Final_Pd_Comission_Totals.SumOfSumOfCommission Rec} else 0


This is {@Draw 2 Live}
if GroupName ({Current_Employees_To_Pay.Officername})={Draw_2_Live.OfficerName} and {@MidTotal}<750 then (750-{Draw_2_Live.Difference})-{@MidTotal}
0
 
frodomanCommented:
Hi Tom,

If you cannot refer to the previous function for looking at this formula, you may be able to deal with it by setting a shared variable.  Within your formula set a shared variable to the formula result.  This variable will then be available on the next record until it is set again.

If you need to refer to the previous value within the same formula that sets it, make sure you capture the value for your comparison before setting it to the new value.  If it is different formulas use the EvaluateAfter() keyword to make sure your comparison formula is run before the formula that sets the value.

hth

frodoman
0
 
Tom_cfglendingAuthor Commented:
frodoman, I kind of understand what your saying...but i've never used variables in crystal could you give me an example? the field i'm trying to refer to is {@To Return}
0
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
The problem is probably due to {@MidTotal}
If it uses any aggregate functions, the formula becomes a second pass formula...

- Ido
0
 
Tom_cfglendingAuthor Commented:
Ok I got it working...Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now