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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Filter' on selected data 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

Non-programmer using CR 7.0 Pro.

Is there any way to filter displayed records once selected?
I have a report which collates stock by lot# to provide a total stock figure for each item. I must select all lot#'s with stock value > 0 to accumulate a total for each item.

The total stock amount is then divided by a monthly usage figure (stored in the database for each item), to provide an estimate of how many months I have in stock for each item. The report prints as I would expect.

However, it does so for every item in the database. What I would like to do now is to display/print only those items for which there is less than (say) 3 months total stock for reordering purposes – can it be done, and if so, how? Selection criteria using grouped data is not possible.

To illustrate:
Description Cat# Usage TotalMths
/Mth Lot# Qty
------------------------------------------------------------
Bulk Soln 26C98.04 0.6 1 1.7
64960 1
Bulk Soln 48A46.01 16.7 69 4.1
66041LU00 4
67045 1
67052 1
68118 43
69211 20

Using 3 months as the reorder cut-off, I'd like to display/print the first entry, but not the second.

What I am after is a sort of post query filter on grouped data, I suppose, and suspect this is a fairly common (and hopefully easily solved) problem.

Many thanks for any assistance!

Johnny_Jebel, Desert Rebel
 
Hi, me again.

The lines in my example did not format properly on send, but I hope you get the idea.

I should also mention that the 'month' calculation isa formula:

Sum({LOT.Stock},{ITEM.ItemName})/{@Usage}

Thanks

JJDR
 
There are two selection formulas, one for record selection and the other for group selection. You use the Group formula for any criteria that relies on subtotals. So you could use a group selection formula like:

Sum({LOT.Stock},{ITEM.ItemName})/{@Usage} * 3 > Sum({LOT.Stock},{ITEM.ItemName})


As you might expect, all of the records get read into memory, but only the ones that meet the second criteria print. This will throw of the grand totals (which will include the non-printing items in memory) so use a running total for any grand totals. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top