Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Help Creating a Sum Formula Post Reply Post New Topic
Author Message
tlw0505
Newbie
Newbie


Joined: 21 Feb 2012
Location: United States
Online Status: Offline
Posts: 1
Quote tlw0505 Replybullet Topic: Help Creating a Sum Formula
     Posted: 21 Feb 2012 at 10:41am

I have a table with 50 violations: '0001. Blah, blah, blah', '0002. Blah, blah, blah', '0003. Blah, blah, blah', etc.  Violations beginning with '0001. - 0023.' should be totaled in a field called 'Minor'; violations beginning with '0024. - 0050.' should be totaled in a field called 'Major'.  Can someone help me create a formula for this scenario?

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Feb 2012 at 11:15am
do you mean counted?
there are a number of ways to do this.
you can create two formuals to sum on (if you do not have duplicate rows).
 
//minorcount
if tonumber(left(table.field,4)) in 1 to 23 then 1
 
//majorcount
if tonumber(left(table.field,4)) in 24 to 50 then 1
 
you can then sum each of these formulas to get the counts
 


Edited by DBlank - 21 Feb 2012 at 11:16am
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