Reputation: 2658
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?
Upvotes: 9
Views: 177745
Reputation: 25
You can try like this:
Sum({Tablename.Columnname})
It will work without creating a summarize field in formulae.
Upvotes: 2
Reputation: 93
You Can simply Right Click Formula Fields- > new Give it a name like TotalCount then Right this code:
if(isnull(sum(count({YOURCOLUMN})))) then
0
else
(sum(count({YOURCOLUMN})))
and Save then Drag and drop TotalCount this field in header/footer.
After you open the "count" bracket you can drop your column there from the above section.See the example in the Picture
Upvotes: 2
Reputation: 7287
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!
Upvotes: 9
Reputation:
(Assuming you are looking at the reports in the Crystal Report Designer...)
Your menu options might be a little different depending on the version of Crystal Reports you're using, but you can either:
Upvotes: 7