Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: I may be a dummy? Post Reply Post New Topic
Author Message
aftershokk
Newbie
Newbie


Joined: 06 Apr 2010
Online Status: Offline
Posts: 11
Quote aftershokk Replybullet Topic: I may be a dummy?
    Posted: 29 Jun 2010 at 6:23am
new to crystal and have a very basic question

I have a cross-tab report as shown below.

Q1-2009                 Q1-2010
in house                   in house
54 units                       22 units

how do I insert a cross-tab column to have a variance (22 units minus 54 units?)

thanks
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 29 Jun 2010 at 11:31am
Hi
You can build yor crosstab using SQL at backend and get the variance too using view or stored procedure below is the sql to start with
 
Select
 SUM (CASE YEAR WHEN 'Q1-2009' THEN Inhouseunits ELSE 0 END ) AS 'Q1-2009',
 SUM (CASE YEAR WHEN 'Q1-2010' THEN Inhouseunits ELSE 0 END ) AS 'Q1-2010',
 'Variance' = SUM (CASE YEAR WHEN 'Q1-2009' THEN Inhouseunits  END )- SUM (CASE YEAR WHEN 'Q1-2010' THEN Inhouseunits  END )
FROM DBO.CROSSTAB
 
Q1-2009  Q1-2010   Variance
54              22                32
 
 
Cheers
Rahul
IP IP Logged
aftershokk
Newbie
Newbie


Joined: 06 Apr 2010
Online Status: Offline
Posts: 11
Quote aftershokk Replybullet Posted: 30 Jun 2010 at 4:02am
can this be done in crystal using the current cross-tab report?
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.016 seconds.