Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2016 : Technical Questions  
Message Icon Topic: match data from one record to another record Post Reply Post New Topic
Author Message
OCTS
Newbie
Newbie


Joined: 30 Oct 2018
Online Status: Offline
Posts: 3
Quote OCTS Replybullet Topic: match data from one record to another record
    Posted: Yesterday at 7:51am
data is as follows:

ID     LOCATION     CONTROL_NUMBER     INGATE_ID
392,001     POLE 7           384287               0
393,341                      385581          392,001

Trying to create a formula which would add another column called OutLocation, which if INGATE_ID is greater than 0 would match the INGATE_ID (392,001) to the ID (392,001 in the above row) and return the LOCATION value (POLE 7) to the row below.

Edited by OCTS - Yesterday at 7:52am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8937
Quote DBlank Replybullet Posted: Yesterday at 8:13am
is this just for display or do you have to then do something more with the result? Is this evaluation only occurring for the next row or can it be more than one row apart?
IP IP Logged
OCTS
Newbie
Newbie


Joined: 30 Oct 2018
Online Status: Offline
Posts: 3
Quote OCTS Replybullet Posted: Yesterday at 8:26am
This would be for display purposes. In this report it would be one row apart, but I also want to have it displayed on a form that would have it displayed in a field.

The row that has a 0 for INGATE_ID is the record that records the receipt of an inventory item. We have a form that is printed which is like a Proof of Delivery and it has a field where the LOCATION can be printed. The record where the INGATE_ID equals the ID of another record is the record that records the inventory item leaving. We also would like the LOCATION to be printed on that form. The only way I can see to do it is to match it to the record that recorded it coming in and pulling the data from there. Is this even possible with Crystal reports?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8937
Quote DBlank Replybullet Posted: Yesterday at 8:36am
consider using a formula field to display using either Previous() or Next() functions

Something like this maybe...?

If Previous(table.ingate_id)=0 and table.Ingate_id=previous(table.Id) then previous(table.location) else ''


Edited by DBlank - Yesterday at 8:36am
IP IP Logged
OCTS
Newbie
Newbie


Joined: 30 Oct 2018
Online Status: Offline
Posts: 3
Quote OCTS Replybullet Posted: Yesterday at 11:54am
This worked for the report but not for the form.

I was able to come up with a solution for the form by creating a subreport linking the (table.ID) to the (table.Ingate Id).

thank you for your assistance.
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.031 seconds.