Solved

Group summary

Posted on 2006-07-20
16
623 Views
Last Modified: 2008-02-01
I have a report with foure columns: Group1, Name1, Status1, and Count1.

The fields are grouped by Group field. So at the end of each group I want to display the Sum for all Count fields for which Status1='L'

I've tried to set the new field to a formula:

Sum ({Count1},{Status1} , "L")

I keep getting an error "A number field or currency amount field is required here" in field Count1.

What am I doing wrong? Or how do I display Sum of all Count1 fields in each Group?
0
Comment
Question by:YZlat
  • 9
  • 6
16 Comments
 
LVL 28

Accepted Solution

by:
bdreed35 earned 500 total points
Comment Utility
You need to create a formula first, then sum the formula:

//@StatusL
if {Status1} = "L"
then {Count1}
else 0

You can then insert a summary off of the formula or create another formula to do so:

Sum({@StatusL},{Group1})
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
bdreed35, the source for my report was an XML file where Count1 is a numeric field, but for some reason Crystal Reports do not read it as numeric.


...
<COUNT1>43</COUNT1>
....

I've tried right-clicking on the Group footer, selecting Insert->Subtotal but in the combobox "Insert subtotal for the field" I don't see Count1. What's going on?

Is there a workaround?
0
 
LVL 28

Expert Comment

by:bdreed35
Comment Utility
You can try using this instead:

//@StatusL
if {Status1} = "L"
then val({Count1})
else 0
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
but where do I put this code? Keep in mind that I'm a novice with Crystal Reports
0
 
LVL 28

Expert Comment

by:bdreed35
Comment Utility
From the View menu, Choose Field Explorer.
Right click Formulas, choose New.
Give it the name "StatusL" and click Use Editor.
Copy and paste the formula into the editor, and make sure you replace {Status1} and {Count1} with the full names.
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
I've done all that. How do I display the value on the report itself now?
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
In the field insertion popup show the formula tab abd drag the formula onto the report just as you do a database field.

mlmcc
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
the problem is that the database for my report is an xml file where COUNT1 field is defined in the following way

<COUNT1>43</COUNT1>

and Crystal Reports does not perceive it as an integer
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 28

Expert Comment

by:bdreed35
Comment Utility
Is this the actual data that you see in the field?
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
yes
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
but Crystal Report reads it as a string "43" instead of an integer 43
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
bdreed35 please help! I'll up the points
0
 
LVL 28

Expert Comment

by:bdreed35
Comment Utility
This formula should work: (it is the same as I posted yesterday)

//@StatusL
if {Status1} = "L"
then val({Count1})
else 0
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
but how do I display Sum({@StatusL},{Group1}) on the report?
0
 
LVL 28

Assisted Solution

by:bdreed35
bdreed35 earned 500 total points
Comment Utility
Once you have the formula built, go to the the Insert menu in the designer, and choose Summary.
In the Summary dialog, choose the formula as the field to summarize, sum as the type of summary, and the location should be Group 1
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
This is great! Thank you!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now