Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crystal Reports: Difference of two hierarcy nodes Post Reply Post New Topic
Author Message
pr1ya
Newbie
Newbie


Joined: 23 Jun 2012
Online Status: Offline
Posts: 2
Quote pr1ya Replybullet Topic: Crystal Reports: Difference of two hierarcy nodes
     Posted: 23 Jun 2012 at 9:17am
Hi,
I have a requirement to get the difference of two nodes.
Here is example


2010
Revenue:     
Ratable Revenue     492,997
Product Revenue     34,008,616
Services Revenue     4,449,767
    Total Revenue     38,951,380
Cost of Sales:     
Ratable Cost     263,208
Product Cost     13,178,913
Service Cost     1,692,402
Restructuring Cost     0.00
    Total Cost of Sales     15,134,523
      Gross Margin     23,816,856

Here I should get the difference of TOTAL REVENUE and TOTAL COST OF SALES
The difference is displayed as GROSS MARGIN.

How can i achieve that in crystal reports.
Any help please
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Jun 2012 at 3:32am
I assume you're grouping by year.  I would create a couple of running total sums.  Since you don't mention your field names, I'm going to use "Money_Type" in this sample as the field that determines whether it's Revenue or Cost and "Amount" as the dollar value.
1.  In the Running Total Expert, select the Amount field as the Field to Summarize and make the running total a SUM.  Call this running total "Revenue"
 
2.  Evaluate:  Use a Formula.  In the Formula Editor, use a formula like this:
 
{Table.Money_Type} = 'Revenue'
 
3.  Reset On Change Of Group and select your year group.  If you're not grouping on year and instead are just selecting a single year as a parameter, chose Reset Never instead.
 
4.  Create another running total for Cost.
 
5.  Create a formula for your Gross Margin:  {#Revenue} - {#Cost}
 
-Dell
 
IP IP Logged
pr1ya
Newbie
Newbie


Joined: 23 Jun 2012
Online Status: Offline
Posts: 2
Quote pr1ya Replybullet Posted: 26 Jun 2012 at 1:25am
Thanks a lot. That worked outSmile
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