Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate sum of a formula field in crystal Reports?

In some inherited code, I see group headers/footers have items like 'Sum of @numcount' . I cannot get the sum of a formula field. Any thoughts?

like image 724
schar Avatar asked Aug 25 '10 21:08

schar


People also ask

How do I sum a formula field in Salesforce?

In the Formulas section, provide an alias for the field that stores the sum, and then select Number as the field type. Select the Sum function, place the cursor within the parenthesis, and then select the field for which you want to calculate the sum. For example, to calculate the sum of amount, use SUM({Amount}).

How do you show formulas in Crystal Reports?

You can right click the field object either in the Field Explorer or on the report canvas and select “Find in Formulas”. The other way to access the formula search is to click on the “binoculars” or press Control-F while you are in the Formula Editor.


1 Answers

The only reason that I know of why a formula wouldn't be available to summarize on is if it didn't reference any database fields or whose value wasn't dynamic throughout sections of the report. For example, if you have a formula that returns a constant it won't be available. Or if it only references a field that is set throughout the report and returns a value based on that field, like "if {parameter}=1 then 1" would not be available either.

In general, the formula's value should not be static through the sections of the report you're summarizing over (Though the way Crystal determines this is beyond me and this doesn't seem to be a hard and fast rule)

EDIT: One other reason why a formula wouldn't be available is if you're already using a summary function in that formula. Only one level of summaries at a time!

like image 63
Ryan Avatar answered Oct 06 '22 22:10

Ryan