Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula to count if a character shows in report Post Reply Post New Topic
Author Message
mjclark
Newbie
Newbie


Joined: 25 Feb 2014
Online Status: Offline
Posts: 2
Quote mjclark Replybullet Topic: Formula to count if a character shows in report
     Posted: 25 Feb 2014 at 10:59am
I have a report made and pulling things I want just one issue.  I have a field that has - O, T or 9 for an input and I am trying to figure out how to build a formula to count the number of instances in the report that 'O' appears and then another report that would show "T & 9" totaled together.  The report generates multiple pages of information for records with listings that are similar in each section.

By the way I am sort of new to Crystal Reports
IP IP Logged
mjclark
Newbie
Newbie


Joined: 25 Feb 2014
Online Status: Offline
Posts: 2
Quote mjclark Replybullet Posted: 26 Feb 2014 at 5:09am
Let me clarify a little more.

I have been trying to add a formula

if {reportfiled.value} = 'O' then 1 else 0 - but this only counts a total of 1 when I really have 25 counts in the report for this

So I am looking to maybe do the following:
if {reportfiled.value} = 'O' then "total all" or count.  I am not sure if this explains what I am looking for.  I have (3) variables that I will be wanting to count on different lines.

My report is pulling data based on parameters that I am picking - i.e. Data range and a location.  So depending on location I pick this could pull hundreds of one of the three variables and want those numbers to show as totals on the header so people are not having to calculate on their own.

I need some help finishing up some
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Feb 2014 at 9:45am
are these all in the same field?
are these the only values in the field or are they part of a longer string?
if they are part of a longer string can you have multiples in the same string on the same row? If so do you count it as 1 or x times that it appears in that field on that row?


Edited by DBlank - 26 Feb 2014 at 9:46am
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