Calculate Sales Qty over last X weeks for an item

erugalatha
erugalatha Member Posts: 120
Hi,

On a Report how do I calculate the Sales Qty. over the last X weeks for an Inventory Item?

Thanks for your help.

Comments

  • HalMdy
    HalMdy Member Posts: 429
    By using a Date filter on the concerning period ...
  • erugalatha
    erugalatha Member Posts: 120
    ok I suppose I should ask what I mean!! :)

    On the request form I have a drop down where the user can select the number of weeks to retrieve the Sales History of an Item for.

    If they select 5 weeks then I need to convert that to a Date Filter for last 5 weeks from TODAY.

    How do I do this conversion?
  • David_Cox
    David_Cox Member Posts: 509
    erugalatha wrote:
    ok I suppose I should ask what I mean!! :)

    On the request form I have a drop down where the user can select the number of weeks to retrieve the Sales History of an Item for.

    If they select 5 weeks then I need to convert that to a Date Filter for last 5 weeks from TODAY.

    How do I do this conversion?

    // Stop Bad Input
    If NoOfWeeks <1 THEN
    NoOfWeeks := 1;

    SETRANGE("Date Filter",TODAY - (NoOfWeeks*7),TODAY);

    :)
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com