AnsweredAssumed Answered

Calculation using preceding records returns a "?"

Question asked by FMNewbie on Aug 25, 2011
Latest reply on Aug 25, 2011 by FMNewbie


Calculation using preceding records returns a "?"


Hi all...

I've searched the forum and I couldn't find anything on this subject so I apologize if I'm repeating something that's been asked before. 

Basically, I have a calcluation field that uses data from the preceding two records.  How do I prevent it from returning a value of "?" in the first couple of records (given that there are no preceding records for it to calculate with)? 

The calculation is supopsed to total meal allowances from the previous two pay periods (records) if the current pay period ends on the 15th.  Here's what I have:

If ( Day(Pay Period End) = 15 ;GetNthRecord ( Earnings Meal Allowance CURRENT ; Get(RecordNumber)-1 )+ GetNthRecord ( Earnings Meal Allowance CURRENT ; Get(RecordNumber)-2 ); 0 )

Obviously for the first and second pay period of the year, this calculation returns a "?"  Any thoughts?