Print Page | Close Window

Summarize a formula field by group

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22754
Printed Date: 02 May 2024 at 6:52pm


Topic: Summarize a formula field by group
Posted By: SallyB
Subject: Summarize a formula field by group
Date Posted: 02 Apr 2019 at 10:48am
In my report I have 2 groups. Group 1 is the person and group 2 is the charge code.

I want to calculate the workload value for each charge code for each person and the total workload value for that person.

I have the following formula: The first converts a string to a number
RVU Number =
if IsNumeric ({WorkloadDefinitionTable.Units})
then ToNumber({WorkloadDefinitionTable.Units}))

The second one I use to calculate a workload value per chargecode
Workload Value =
{@RVU Number}*DistinctCount ({SpecimenChargeSlipTable.ObjectID}, {SpecimenChargeSlipTable.Code})

Now I want to add all the workload values for the charge codes for each person into a total workload per person. Crystal does not allow me to summarize the workload value formula. I tried
Sum ({@Workload Value},{@Grosser} )
but get an error that the @workload value cannot be summarized.

How can I accomplish what I want to do? Thank you!



Replies:
Posted By: hilfy
Date Posted: 19 Apr 2019 at 3:19am
Unfortunately, you cannot summarize a value that comes from a formula that contains a summary function. However, you might be able to use a running total to get this - use the second formula as the field to summarize, have the summary calculate for each {SpecimenChargeSlipTable.Code}, and reset on change of the person group.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: SallyB
Date Posted: 22 Apr 2019 at 7:19am
Thank you for your response. I tried to do as you suggested but unfortunately the second formula is not in the list of available fields to summarize in a running total. This seems crazy. There should be a way to do what I want but I sure cannot find it. Thanks again for your help.



Print Page | Close Window