In a complex call report for a pharma client, I am receiving a false "Summary / Running Total field could not be created" error. The report is being created using CR 8.5.
The formula {@R6TargetCallsAvg - GF2} is designed to calculate the average number of calls a sales rep makes to R6 rated physicians in his/her territory. It is the sum of Actual R6 Calls made in a month divided by the monthly R6 Calls Objective ( Sum of {R6TargetCallsAct - GF2} / {R6TargetCallsObj - GF2})
The formula I used is as follows:
[tt]WhilePrintingRecords;
if {@R6TargetCallsObj - GF2} = 0 then 0
else Sum ({@R6TargetCallsAct - GF2}, {Physician.Territory}) / {@R6TargetCallsObj - GF2}[/tt]
{@R6TargetCallsObj - GF2} is actually DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})
So both fields are grouped on {Physician.Territory}, and the formula is placed in GF2, grouped on {Physician.Territory}!
To further confuse the issue, this formula works (for calls to non-target physicians):
[tt]Sum ({@NonTargetCalls - D}, {Physician.Territory}) / DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})[/tt]
But this one doesn't!!! (I get a "the Summary / Running Total field could not be created" error):
[tt]Sum ({@R6TargetCallsAct - GF2}, {Physician.Territory}) / DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})[/tt]
I then broke it down into components. This formula works:
[tt]DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})[/tt]
I then discovered that it is this component that gives me the "Summary / Running Total field could not be created" error message:
[tt]Sum ({@R6TargetCallsAct - GF2}, {Physician.Territory})[/tt]
The contents of {@R6TargetCallsAct - GF2} are real simple:
[tt]WhilePrintingRecords;
local numbervar TargetCall := 0;
// local because I intend to re-use the same formula for R5 and R4 physicans
if {Physician.status} = "Z" then TargetCall := 1;
TargetCall[/tt]
It then gets summarized by CR to calculate the number of calls that were made. I have used this kind of logic dozens of times and have never had this problem before. Probably something real dumb...
Any ideas? This is driving me wacky. I took a look on the CR KBase and couldn't find any hints there... Also checked the SR PDFs' to see if this was a known error that had been fixed. And did a search here to see if anyone else has been driven to distraction by this!
Thanks very much,
John Marrett
Crystal Reports Trainer & Consultant
The formula {@R6TargetCallsAvg - GF2} is designed to calculate the average number of calls a sales rep makes to R6 rated physicians in his/her territory. It is the sum of Actual R6 Calls made in a month divided by the monthly R6 Calls Objective ( Sum of {R6TargetCallsAct - GF2} / {R6TargetCallsObj - GF2})
The formula I used is as follows:
[tt]WhilePrintingRecords;
if {@R6TargetCallsObj - GF2} = 0 then 0
else Sum ({@R6TargetCallsAct - GF2}, {Physician.Territory}) / {@R6TargetCallsObj - GF2}[/tt]
{@R6TargetCallsObj - GF2} is actually DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})
So both fields are grouped on {Physician.Territory}, and the formula is placed in GF2, grouped on {Physician.Territory}!
To further confuse the issue, this formula works (for calls to non-target physicians):
[tt]Sum ({@NonTargetCalls - D}, {Physician.Territory}) / DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})[/tt]
But this one doesn't!!! (I get a "the Summary / Running Total field could not be created" error):
[tt]Sum ({@R6TargetCallsAct - GF2}, {Physician.Territory}) / DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})[/tt]
I then broke it down into components. This formula works:
[tt]DistinctCount ({@DaysOnTerrAct - D}, {Physician.Territory})[/tt]
I then discovered that it is this component that gives me the "Summary / Running Total field could not be created" error message:
[tt]Sum ({@R6TargetCallsAct - GF2}, {Physician.Territory})[/tt]
The contents of {@R6TargetCallsAct - GF2} are real simple:
[tt]WhilePrintingRecords;
local numbervar TargetCall := 0;
// local because I intend to re-use the same formula for R5 and R4 physicans
if {Physician.status} = "Z" then TargetCall := 1;
TargetCall[/tt]
It then gets summarized by CR to calculate the number of calls that were made. I have used this kind of logic dozens of times and have never had this problem before. Probably something real dumb...
Any ideas? This is driving me wacky. I took a look on the CR KBase and couldn't find any hints there... Also checked the SR PDFs' to see if this was a known error that had been fixed. And did a search here to see if anyone else has been driven to distraction by this!
Thanks very much,
John Marrett
Crystal Reports Trainer & Consultant