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!

Setting Detail values based on a group summary 1

Status
Not open for further replies.

JanCampbell

Instructor
Jun 19, 2003
11
GB
Hi
I am fairly new to Crystal and not that technical so hope you can help.
I have a report grouped by an ID field eg.

Group Header: 21189
Detail: Company A Value 1
Company B Value 2
Group Footer: Count({Company})

I want to set the value field for all records in the detail section to 0 if the Count is >=2.

I can suppress the whole group by adding a formula to the Detail section but the values are still used in my grand total. I tried to use the Group selection option but this didn't work.

Any help would be much appreciated.
Thanks in advance.
Jan
 
You could replace your field {table.value} with the following formula {@value}:

if count({table.company},{table.ID}) >= 2 then 0 else {table.value}

Then insert your summary on {@value}.

Or, alternatively, if you don't want to display these groups, then use the group select. Go to report->edit selection formula->group and enter:

count({table.company},{table.ID}) < 2

Then you would need to use running totals to get your summaries. Select {table.value}, sum, evaluate for each record, reset on change of group (ID). This way the records that were not group selected will not contribute to the summary.

-LB

 
I have used the Group selection and running totals suggestion and this has worked.
Thank you so much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top