Date array for report
cwiginton
Member Posts: 16
Hello,
I'm a bit new to report writing in Nav. Current version is 3.7. I need to create a sales analysis report with 20 columns where each column represents sales per week. I do not know the correct date formula to do this.
I'm using the customer table, "Date Filter" field and the Sales$ field.
The report will run automatically so week20 should = CW and week1 should be less 19.
This is how I'd like the report to look:
Cust No. wk1 wk2 wk3 wk4 current week!
##### Sales[1] Sales[2] Sales[3] Sales[4]...........Sales[20]
:-k
Thanks!
Cat
I'm a bit new to report writing in Nav. Current version is 3.7. I need to create a sales analysis report with 20 columns where each column represents sales per week. I do not know the correct date formula to do this.
I'm using the customer table, "Date Filter" field and the Sales$ field.
The report will run automatically so week20 should = CW and week1 should be less 19.
This is how I'd like the report to look:
Cust No. wk1 wk2 wk3 wk4 current week!
##### Sales[1] Sales[2] Sales[3] Sales[4]...........Sales[20]
:-k
Thanks!
Cat
0
Comments
-
20 Coloumns? Oui, it's a wide report :-D
i := 0; DateREc.setrange("Period Type",DateREc."Period Type"::Week); DateREc.setrange("Period Start",calcdate('<-CW>-<19W>',Today),calcdate('<CW>',today)); if DateREc.find('-') then begin repeat i := i + 1; setrange("Date Filter",DateREc."Period Start",DateREc."Period End"); calcfields("Sales (LCY)"); WeekArray[i] := format(DateREc."Period Start") + '..' + format(DateREc."Period End"); //this is only to display the filter of the Week SalesArray[i] := "Sales (LCY)"; until DateRec.next = 0; end;
not tested, but it should work.
DateRec is a recordvariable of Subtype Date.
regardsDo you make it right, it works too!0 -
There is a post that does sales by customer by month
viewtopic.php?f=5&t=10082
It Looks Like This:
http://savatage99.googlepages.com/Custo ... yMonth.pdf
It could easily be changed to do weeks instead of months - but 20 columns is going to have been real small print.
Here's a copy of the .fob
http://savatage99.googlepages.com/Repor ... yMonth.fob
Note: once done it's also easily changed to show purchases by vendor by month0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions