Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: noob formula question Post Reply Post New Topic
Author Message
stevo
Newbie
Newbie


Joined: 21 Feb 2013
Online Status: Offline
Posts: 1
Quote stevo Replybullet Topic: noob formula question
     Posted: 21 Feb 2013 at 7:14am
Hello,
 
I have a really noob-level question. I'm trying to customize a pre-existing report (Crystal 11.5). In our SQL database, unique accounts are identified by Trips.tdate+Trips.job, which are both string-type fields. In said report, there's a distinct count of formula Trips.tdate+Trips.job to give the total number of trips for the group in the report. I want to add to the report by giving a breakdown of the total trips by type of trip. So, for instance, in my head, I was going to create additional formulas such as:
 
Trips.tdate+Trips.job where Trips.calltype=1
Trips.tdate+Trips.job where Trips.calltype=2
Trips.tdate+Trips.job where Trips.calltype=3
 
Based on those formulas, I was going to additional distinct counts of those formulas to give me my breakdowns. I found out very quickly that this wouldn't work, as Trips.calltype is a number-type field, and the formula errors out expecting a string.
 
I honestly don't know how to work around this. If one of you wouldn't mind pointing me in the right direction, I would be very thankful.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Feb 2013 at 8:56am
Running Totals with evaluation formulas, but these have to go into report footers. You can use shared variable formulas or the standard versions.
If is must be in a header you could consider a crosstab.
a Running total example
name=type1
field to sumamrize=formula field (Trips.tdate+Trips.job)
type = distinctcount
evaluate=use a formula
Trips.calltype=1
reset=never
place in report footer
 
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