• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5153
  • Last Modified:

There must be a group that matches this field?

I am trying to add a formula field into my report but when I try to verify it I keep getting an error "There must be a group that matches this field."    The situation is that I am converting an existing report to connect into an oracle database.   The original code for the field, pulling the data from a stored procedure is as follows:  

if {USP_RPT_STOCKLINES_AGING.QTY_USED} = 0 then
    formula = Sum ({USP_RPT_STOCKLINES_AGING.QTY_OH}, {USP_RPT_STOCKLINES_AGING.PN})
elseif Sum ({USP_RPT_STOCKLINES_AGING.QTY_OH}, {USP_RPT_STOCKLINES_AGING.PN}) >= {USP_RPT_STOCKLINES_AGING.QTY_USED} then
    formula = Sum ({USP_RPT_STOCKLINES_AGING.QTY_OH}, {USP_RPT_STOCKLINES_AGING.PN}) - {USP_RPT_STOCKLINES_AGING.QTY_USED}
else
    formula = 0
end if


What I produced is below.  I was getting various other errors which were fixed by changing certain keywords and stuff like that.  But with the code below I keep getting the error I mentioned.  


if {command.QTY_USED} = 0 then
 Sum ({command.QTY_OH}, {command.PNm_auto_key})
else if Sum ({command.QTY_OH}, {command.PNm_auto_key}) >= {command.QTY_USED} then
    Sum ({command.QTY_OH}, {command.PNm_auto_key}) - {command.QTY_USED}
else
     0


Any help?  
0
patsylipp
Asked:
patsylipp
  • 2
  • 2
1 Solution
 
mlmccCommented:
Does the report have a group on this field, {command.PNm_auto_key}?

mlmcc
0
 
patsylippAuthor Commented:
No, there is one grouping and it is done on another field that is selected from within COMMAND.   The problem is that that grouping is too broad for what I am trying to do.  The pnm_auto_key links me to quantity details for one record.  The field I am grouping by has many many records that would be associated with it.

0
 
mlmccCommented:
You are trying to summarize on a group.  So in the report there must be a group otherwise Crystal cannot do the summary.

mlmcc
0
 
patsylippAuthor Commented:
Ok, that did it!   I didnt realize that the group had to be added into the report.  Added in the group, suppressed it, hid it, and then was able to do the formula the way I wanted to.   Thanks!  
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now