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!

Having Both Record and Group Selection in a report?

Status
Not open for further replies.

jaybar48

Technical User
Feb 16, 2002
61
US
1) Which takes precidence?

2) How does the presence of BOTH record and group selection effect the selected records?

3) If you have both Record and Group Selection, how does this effect the computation of percentages?

Thanks in Advance,


Jay
 
1) Which takes precidence?

Neither should in theory, they will both be passed. If they conflict, don't do that...

2) How does the presence of BOTH record and group selection effect the selected records?

They're both used.

3) If you have both Record and Group Selection, how does this effect the computation of percentages?

It shouldn't have any effect, except that you get a different rowset the more filtering you do.

-k
 
Thank you, but the basic question still exists.


If you have both Record and group selection, does Crystal first select the records and then among those records, only select those that match the group selection criteria or the other way around?

Also, if I want a Total N for all records that meet the record selection criteria, without regard to the group selection criteria, would I need a sub report and how can I pass that parameter to compute percentages?

Jay
 
The record selection formula selects the set of records for the report, and then the group select selects from among that set those records or groups that meet the group selection criteria. You can change the group criteria without the report refreshing (as long as the new criteria are already represented in the original record set), because the non-group selected records still exist in the report.

For calculations involving only the group-selected records, for most calculations you would need to use running totals, since the non-group selected records will still contribute to summaries like "count", "sum", etc. That means that you can use those summaries without needing a subreport, if you want to ignore the group selection criteria. If you wanted to do a percentage of a subtotal amount in a group meeting group selection criteria to the total records (including non-group selected), you could do a formula:

count({table.amount},{table.field}) % count({table.field})

But if you then wanted to total this for the group selected groups, you would need to create a manual running total.

If you wanted to do a count of all detail records meeting the group selection criteria, you would also need to use a running total.

-LB
 
There isn't a precedence.

A Group selection will always occur, as will the record selection.

However since most people don't design a report to pass group selection criteria via SQL, the record selection will most likely occur on the server side, and the group on the report, but it still depends on design.

Check the Database->Show SQL Query.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top