Print Page | Close Window

Group Summary formula

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19016
Printed Date: 18 Apr 2024 at 10:09am


Topic: Group Summary formula
Posted By: bash
Subject: Group Summary formula
Date Posted: 01 Feb 2013 at 10:40pm
Hi,
I am using CR 9.2. Please help me to form a formula for a group header. When i use 'Insert>Summary', it gives me exact summary of my group. But no option to put a condition by date range. How can i make a conditional sum for a group? I will try to explain it more with an example:
 
Sugar (Group)  (Summary of below items needed here with condition of date. Eg: 50)
  - Sugar itemA      20
  - Sugar itemB      20
  - Sugar itemC      10
 
Tea (group)      (Summary of below items needed here with condition of date. Eg:40)
  - Tea itemA          10
  - Tea itemB           10
  - Tea itemC           20
 
 
Thanks for your help..
 



Replies:
Posted By: lockwelle
Date Posted: 11 Jul 2013 at 4:23am
I know way late...but shared variables or running totals would be the answer.

shared variables come in groups of 3 formulas usually:
reset (group header)
shared numbervar s:=0;
"" //hides the 0 from the formula

increment (details)
shared numbervar s;
if {table.field1} > some criteria then
s := s + {table.field2};

"" //hides the output

display (group footer)
shared numbervar s

I know it is late, but perhaps it will help in the future.
The locations: group header/footer and detail are just suggestions/most typical locations for these formulas.




Print Page | Close Window