# Group Selection Formula, Filtering Records: Crystal Reports 8.5

• March 19th, 2013, 11:14 AM
crystalrptguy1
Group Selection Formula, Filtering Records: Crystal Reports 8.5
Hi,

I am having trouble filtering out certain records in my Group Selection(or Record Selection if it could be used) with summary and formula fields in Crystal 8.5. The formula(@NET UNRL AS A % OF BV BY CUSIP) is..

if Sum ({Currhold.GBSEBK_VALUE_P}, {Currhold.CUSIP}) = 0 then 0 else
(Sum ({@UNREALIZED G/L}, {Currhold.CUSIP})/Sum ({Currhold.GBSEBK_VALUE_P}, {Currhold.CUSIP}))*100

and the @UNREALIZED G/L formula is..

{Currhold.GBSEMKT_VALUE_P}-{Currhold.GBSEBK_VALUE_P}

I am trying to show only records where @NET UNRL AS A % OF BV BY CUSIP is > 200. However, when I try to use this formula in the Group Selection it tells me "The Formula Must be Evaluated Later". Also, if I try to use the code for the @NET UNRL AS A % OF BV BY CUSIP formula in the Group Selection it tells me there is a division by 0. I have tried numerous variations of IF statements to eliminate the division by 0 and obtain the proper records, but nothing has seemed to work. My report is grouped by Currhold.CUSIP. Any help is greatly appreciated, and thanks in advance!
• March 22nd, 2013, 11:34 AM
Ned Pepper
Re: Group Selection Formula, Filtering Records: Crystal Reports 8.5
The answer is in the "The Formula Must be Evaluated Later" message. Your group is based on the Currhold.CUSIP field. You cannot use aggregations based on this field to filter the group becuase you create a paradox - you can't determine which records should be in the group until you proccess the group. You generally have two options
1 - create a view or stored procedure in your database to create the aggregations and then filter based on the results.
2 - use a sub report to create the aggregations and then only display qualifying records in the main report.
I would choose #1.