Link to home
Start Free TrialLog in
Avatar of Bad_Fish
Bad_FishFlag for United States of America

asked on

Rolling Twelve Month Count

This inventory report shows all "Item Numbers" that have fallen below their set "Reorder Point." This report allows our parts manager to walk the aisles and confirm quantities before placing an order. The report uses the "Inventory" table to produce these numbers.

He would find it very helpful if I could display a rolling twelve month count of the number (or quantity) of each item sold. To do this, I'll need to incorporate the "Invoices" table and loop through the table getting a count (over the last twelve months) of the number sold for each Item Number. For example; maybe we sold 14 of Item#1101600030 and 33 of Item#1102400016 and 0 of Item#1102400017 (the first three records below).

User generated image
I've not encountered a situation like this before (in Crystal). What is the best way to go about getting a count for the number of each item sold...keeping in mind that it cannot change record selection as the report is meant to display items that have fallen below their Reorder Point. For those items, I only wish to display how many of each were sold over the last twelve months.
ASKER CERTIFIED SOLUTION
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Create a view which groups the data by item and calculates the count. Set the where clause to the last 12 months. Join the view with your current data by the item's id ...
Avatar of Mike McCracken
Mike McCracken

Building on IdoMillet's idea of the conditional sum

Add a group on the Item Number.  
Suppress the group header and footer

You can build a formula like
If {InvoiceDate} >= DateAdd('yyyy',-1,CurrentDate) Then
    {InvoiceQty}
Else
    0

Open in new window


You could then use a summary on the formula to get the total sold in the time frame.  Put the summary in the detail section.

mlmcc
Avatar of Bad_Fish

ASKER

I employed IdoMillet's suggestion and it works great. Thanks to everyone!