Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error - Cannot Summarize this Field - Please help with Formula

Status
Not open for further replies.

ESPMH

Technical User
Feb 9, 2010
4
US
I want to count {@meets numerator} by Department, but I continue to get "this field cannot be summarized". I am using crystal report 11. Can I use whileprintingrecords to summarize this data? (See Report structure below with formula’s)

Group 1 – Department

Department Name Employee Denominator Employee Numerator
A 50 ??

Formula Employee Denominator
Distinctcount({table.Employee_Name}, {table.Department})

Group 2 – Employee Name

EmployeeName Sum of ID-1 Sum of ID-2 Meets Numerator
Name1 3 2 1


Formula for Sum of ID-1
Sum{@ID-1},{table.employee_name}

Formula for Sum of ID-1
Sum{@ID-2},{table.employee_name}


Formula for Meets Numerator
if Sum ({@ID-1}, {Table.employee_name}) >=3 and
if Sum ({@ID-2}, {Table.employee_name}) >=2 then 1 else 0

Detail

Field ID ID-1 ID-2
1 1 0
2 0 1
1 1 0
42 0 1
21 1 0


Formula for ID-1
If {table.FieldID} = 1 then 1 else
If {table.fieldID} = 21 then 1


Formula for Field ID-2
If {table.fieldID} = 2 then 1 else
If {table.fieldID} = 42 then 1
 
Use three formulas:

//{@reset} for the dept group header:
whileprintingrecords;
numbervar x;
if not inrepeatedgroupheader then
x := 0;

//{@accum} to be placed in the section containing {@MeetsNumerator}:
whileprintingrecords;
numbervar x := x + {@MeetsNumerator};

//{@display} for the department group footer:
whileprintingrecords;
numbervar x;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top