I am struggling to udnerstand why the peek function is not working correctly for me.
I am using the following code to ascertain if two consecutive rows have a flag, and if so populate a row:
Load *, if(EmailFlag = '1', if(peek(PlanFlag) = EmailFlag and peek(OpCode) = OpCode and peek(account) = account,'Email Sent','Email Not Sent'),'') as EmailSentFlag
Order by account,OpCode, date,time desc;
The strange thing is that for some records it works fine - however for others it does not. As you can see from the below, there are 3 occasions where both flags are populated but only one shows Email Sent in the EmailSentFlag column despite the same conditions being met.
Please check that the table in the front end you are looking at is sorted in the exact order and direction as in the load script (e.g. by adding a Recno() as RecID in the load and sort by this field in your front end).
I noticed that your date and time fields are showing same values for the records (per case), could that be a problem?