Need help

raja123raja123 Posts: 35Member
Calculate the monthly average sales of the item by taking the last six months sales and display it on item card

using nav2017

Best Answer

Answers

  • krikikriki Posts: 8,723Member, Moderator
    [Giving your topic a good title and explaining better what you need might help. This seems like you haven't the slightest idea what you need to do and want a complete solution from the community.]
    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
  • KTA8KTA8 Posts: 243Member
    You need to sum all the period, for that
    //filter sales
    recItemEntries.SETRANGE(recItemEntries."Entry type",recItemEntries."Entry type"::Sale);
    //item
    recItemEntries.SETRANGE(recItemEntries.Nº,youritem);
    //period of time
    startdate=CALCDATE('<-6M>',TODAY);
    recItemEntries.SETRANGE(recItemEntries.postingdate,startdate,TODAY);
    //total period
    recItemEntries.CALCSUMS(recItemEntries.quantity);
    //average
    avg=recItemEntries.quantity/6;
  • raja123raja123 Posts: 35Member
    KTA8 wrote: »
    You need to sum all the period, for that
    //filter sales
    recItemEntries.SETRANGE(recItemEntries."Entry type",recItemEntries."Entry type"::Sale);
    //item
    recItemEntries.SETRANGE(recItemEntries.Nº,youritem);
    //period of time
    startdate=CALCDATE('<-6M>',TODAY);
    recItemEntries.SETRANGE(recItemEntries.postingdate,startdate,TODAY);
    //total period
    recItemEntries.CALCSUMS(recItemEntries.quantity);
    //average
    avg=recItemEntries.quantity/6;

    I want Monthwise
  • raja123raja123 Posts: 35Member
    kriki wrote: »
    [Giving your topic a good title and explaining better what you need might help. This seems like you haven't the slightest idea what you need to do and want a complete solution from the community.]

    I'll try to implement your suggestions , thank you
Sign In or Register to comment.