Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: VLOOK UP function Post Reply Post New Topic
Author Message
Pras
Newbie
Newbie
Avatar

Joined: 31 May 2011
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote Pras Replybullet Topic: VLOOK UP function
     Posted: 13 Jun 2011 at 12:25am
Hi,

Does anyone know if there exists a similar function to VLOOK UP (in Excel) in Crystal Reports 2008? I'm trying to automate a column that compares the costs column of a previous report and costs of the current report and find the difference between the two periods.

Any help to resolve this would be greatly appreciated.

Thanks in advance,
Pras
IP IP Logged
freestylepunk
Newbie
Newbie
Avatar

Joined: 05 May 2011
Location: United States
Online Status: Offline
Posts: 13
Quote freestylepunk Replybullet Posted: 14 Jun 2011 at 2:33pm
"compares the costs column of a previous report and costs of the current report"
 
I assume you're talking about 2 totally different reports?  Or the same report that is run for different parameters?
 
One way to do it is to create a subreport in the report header that runs the "previous" report and puts the data into variables or arrays.  Pass this information into the main report and do the comparison.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 15 Jun 2011 at 4:07am
freestylepunk's answer seems reasonable, just hope that the report isn't too long running as you are in essence running the report twice...
 
but I don't see much of a solution, unless you want to write a stored proc which might be able to get to the answer a bit faster.
 
Crystal doesn't 'know' about previous reports, it would need to regather the data as freestylepunk mentioned, which it can do via a subreport
IP IP Logged
Pras
Newbie
Newbie
Avatar

Joined: 31 May 2011
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote Pras Replybullet Posted: 16 Jun 2011 at 4:08am
These are two different reports. For example I need to see the movement between the costs of this month compared to last month. In this case, I need to pull information from last month's report (the total costs column for a particular reference number) and then subtract it with this month's cost.

To summarise, the movement for this month = Total costs for this month - Total costs for last month.
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