Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare summary data from 2 weeks 1

Status
Not open for further replies.

sdzlkds

Technical User
Oct 20, 2005
41
GB
I need to set up a report that summarises data from "last week" and the "week before last" which then shows the dfference between the values, so

Value Week Before Last Last Week Difference
Value A 50 100 50
Value B 100 50 -50

and so on...

I've tried doing this as a cross-tab but can't get the righ result to appear inthe "Difference" field

I'm using Crystal 10

I'd be grateful for any assistance

Thanks
 
Insert a group on {table.value} and then create two formulas like this:

//{@weekbeforelast}:
if {table.date} in minimum(lastfullweek)-7 to maximum(lastfullweek)-7 then {table.amt}

//{@lastweek}:
if {table.date} in lastfullweek then {table.amt}

Place these in the detail section and insert sums on them at the group level, and then suppress the detail section (drag the groupname into the group footer). Then create a formula for the difference to be placed in the group footer:

//{@diff}:
sum({@lastweek},{table.value}) - sum({@weekbeforelast},{table.value})

-LB
 
Brilliant. Many thanks for helping me out (again)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top