Rolling Twelve Month Count

Posted on 2014-08-28
Last Modified: 2014-09-03
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).

Parts Order Report
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.
Question by:Bad_Fish
    LVL 22

    Accepted Solution

    One option is to place in that column a linked subreport (or a correlated SQL Expression) that returns the desired total.

    Another option is to do an outer join to the "invoices" table, group on Item Number.  Show the item row data in the Group Footer, and display a conditional total (condition being on the invoice data range) of the quantity from the invoice also in the group footer.
    LVL 22

    Assisted Solution

    Forgot to mention: consider adding a ratio to the report of (12*On Hand)/(12 Month Sales).
    This would allow the manager to easily recognize how many months of inventory you have on hand.
    LVL 18

    Expert Comment

    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 ...
    LVL 100

    Expert Comment

    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

    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.


    Author Closing Comment

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

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now