YZlat
asked on
Group summary
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?
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can try using this instead:
//@StatusL
if {Status1} = "L"
then val({Count1})
else 0
//@StatusL
if {Status1} = "L"
then val({Count1})
else 0
ASKER
but where do I put this code? Keep in mind that I'm a novice with Crystal Reports
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.
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.
ASKER
I've done all that. How do I display the value on the report itself now?
In the field insertion popup show the formula tab abd drag the formula onto the report just as you do a database field.
mlmcc
mlmcc
ASKER
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
<COUNT1>43</COUNT1>
and Crystal Reports does not perceive it as an integer
Is this the actual data that you see in the field?
ASKER
yes
ASKER
but Crystal Report reads it as a string "43" instead of an integer 43
ASKER
bdreed35 please help! I'll up the points
This formula should work: (it is the same as I posted yesterday)
//@StatusL
if {Status1} = "L"
then val({Count1})
else 0
//@StatusL
if {Status1} = "L"
then val({Count1})
else 0
ASKER
but how do I display Sum({@StatusL},{Group1}) on the report?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is great! Thank you!
ASKER
...
<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?