Print Page | Close Window

Group by alpha split and sum amounts

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
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=10114
Printed Date: 07 May 2024 at 1:29am


Topic: Group by alpha split and sum amounts
Posted By: Paula L
Subject: Group by alpha split and sum amounts
Date Posted: 26 May 2010 at 3:47pm
I have created a crystal report that contains 2 columns.  The first column contains last name sorted A to Z the second column contains a dollar amount. One amount for each name.
Anderson  $10.00
Camp        $10.00
Franks       $10.00
Gapp          $10.00
 
Some where on the report I also want to see
A-F   $20.00
G-N   $20.00
 
How do I accomplish this? 
Note: I have only been using Crystal Reports for about 1 month so techy I'm not.


-------------
Paula L



Replies:
Posted By: DBlank
Date Posted: 27 May 2010 at 4:12am
You can create a formual field to get your sums for different 'groupings'
@AtoF ...
if left({table.namefield},1) in 'A' to 'F' then table.amount else 0
 
@GtoN
if left({table.namefield},1) in 'G' to 'N' then table.amount else 0


Posted By: Paula L
Date Posted: 01 Jun 2010 at 12:37pm
I tried the first formula for A to F and it only calculated last name of A...suggestions?

-------------
Paula L


Posted By: DBlank
Date Posted: 02 Jun 2010 at 4:09am
Hmmm.
You can use this instead. Was trying to save some typing...
@AtoF ...
if uppercase(left({table.namefield},1)) in ['A','B','C','D','E','F'] then table.amount else 0



Print Page | Close Window