#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Need help

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

• 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)
• 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;
• 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
• 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