Store Sales Comparison Report

JamieBrown
Member Posts: 107
Hi,
I have searched the forum, but couldn't find anything that relates.
I need to create a comparison report showing store sales by period. For example: the Report could show a stores sales for June for 2005 against 2006. (Ideally on the same line)
Is this possible?
Many thanks in advance.
Jamie
I have searched the forum, but couldn't find anything that relates.
I need to create a comparison report showing store sales by period. For example: the Report could show a stores sales for June for 2005 against 2006. (Ideally on the same line)
Is this possible?
Many thanks in advance.
Jamie
0
Comments
-
Hi Jamie, have a look at the tutorials on my website, it will give you an Idea of how to use the PeriodFormManagement codeunits built in functions to do what you want.
Many GB retailers use non standard Periods, so just going back 12 months may not work, the GB version uses different functions to the worldwide version, this will allow for 4-4-5 Accounting for Retail, you can download the report and pdf from my downloads page as well.
http://www.adeptris.com/Dynamics/Tutorials/DynamicDateReport/tabid/72/Default.aspx
Hope this helpsAnalyst 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.com0 -
If each store represents a location you can use the following method with a location filter applied to the item table :
Take a look in the OnPreReport Trigger of Report 712. A second ItemStatisticsBuf record variable is needed ItemStatisticsBufLastYear to which the last years period date filter can be applied. Use COPYFILTERS first to copy all other filters from ItemStatisticsBuf, then modify the date filter :
You can calculate the period for the last year with code like this:FirstDay := GETRANGEMIN("Date filter"); LastDay := GETRANGEMAX("Date filter"); FirstDayLastYear := CALCDATE('<-1Y>',FirstDay); LastDayLastYear := CALCDATE('<-1Y>',LastDay); ItemStatisticsBufLastYear.SETRANGE(LastYearDateFilter,FirstDayLastYear,LastDayLastYear);
Use the ItemStatisticsBufLastYear Variable and correspondingly
SalesQtyLastYear
SalesAmountLastYear
COGSAmountLastYear
ItemProfitLastYear
in the Calculate Function to calculate the values for the last year (basically, make a copy of each function and change the ItemStatisticsBuf to ItemStatisticsBufLastYear)
Edit 24 Nov 2015: Code snippet battered by forum upgradeKai Kowalewski0 -
In the UK many Retail Customers use 4-4-5 Accounting, this gives fifty two weeks and twelve Periods, that start on the same day of the week, four thirteen week quarters of 91 days, so the financial year start moves each year as there are always 364 days in the finacial year, this is so the same period the previous year starts on the same day and has equal number of days, which is critical for accounting projections.
I am sure this is a quirk of UK auditors, so the CALCDATE('-1Y',myDate), is not suitable, there is in the GB version code to deal with this and this should be considered for Store reporting, we have user definable Weeks, Periods, Quarters and Years, as some Customers want the weeks to run from a different day maybe a wednesday, period 1 could be 1st to the 28 and period 2 starts on the 29th of the same month.
I hope this helps explain the UK, Retail accounting requirments, to the forum users from other lands, thus why suggested using the PeriodFormManagement Codeunit for GB requirements.
DavidAnalyst 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.com0 -
Here's a post from Tip's N Tricks about Colums using arrays.
I have used this successfully and I think it can easily be modified to compare two months a year apart.
Maybe changing the array to 13 and only showing [1] & [13]
Note; Also easily changable for use for Vendor Purchases too..
http://www.mibuso.com/forum/viewtopic.php?t=10082
Here's my report
http://www.geocities.com/navision_attai ... yMonth.txt
(Edit) - Ooops I should have read the previous post :whistle:0 -
Pressed Quote instaed of edit :oops: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.com0 -
:oops: Twice !!David Cox wrote:In the UK many Retail Customers use 4-4-5 Accounting, this gives fifty two weeks and twelve Periods, that start on the same day of the week, four thirteen week quarters of 91 days, so the financial year start moves each year as there are always 364 days in the finacial year, this is so the same period the previous year starts on the same day and has equal number of days, which is critical for accounting projections.
I am sure this is a quirk of UK auditors, so the CALCDATE('-1Y',myDate), is not suitable, there is in the GB version code to deal with this and this should be considered for Store reporting, we have user definable Weeks, Periods, Quarters and Years, as some Customers want the weeks to run from a different day maybe a wednesday, period 1 could be 1st to the 28 and period 2 starts on the 29th of the same month.
I hope this helps explain the UK, Retail accounting requirments, to the forum users from other lands, thus why suggested using the PeriodFormManagement Codeunit for GB requirements.
David
This code is taken from Cronus UK Customer Statistics and has been altered to give you what you want.
Finds Curent period then back 12 Periods
IF CurrentDate <> WORKDATE THEN BEGIN
CurrentDate := WORKDATE;
Calendar."Period Start" := CurrentDate;
PeriodFormMgt.SetCalendarSource(CalendarSource);
PeriodFormMgt.FindDate('',Calendar,2);
CustDateFilter[1] := PeriodFormMgt.BuildDateFilter(Calendar);
CustDateName[1] := Calendar."Period Name";
PeriodFormMgt.NextDate(-12,Calendar,2);
CustDateFilter[2] := PeriodFormMgt.BuildDateFilter(Calendar);
CustDateName[2] := Calendar."Period Name";
END;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.com0 -
Thanks for all your help!
David,
I've got a copy of your tutorial and have started working through it. (Is proving extremely useful)!.
Kowa,
I used your example to get the report working, although as David said we need to use 4-4-5 longterm.
Thanks again.
Jamie0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions