Date Filter on Item Ledger Entries

MiSta
Member Posts: 19
Hello
i want the customers revenue for current year (until today) in my customer table.
i created a flowfield "revenue" (type sum with connection to ledger entries) which filters everything but the date.
i also have a field called "date filter" in my customer table, which is a flow filter field.
the flowfield filters according to the flowfilterfield. where do i have to tell my flowfilterfield, what and how it has to filter?
if the structure of my program is correct, i would be glad, if anyone could tell me, what i have to do.
thanks in advance
i want the customers revenue for current year (until today) in my customer table.
i created a flowfield "revenue" (type sum with connection to ledger entries) which filters everything but the date.
i also have a field called "date filter" in my customer table, which is a flow filter field.
the flowfield filters according to the flowfilterfield. where do i have to tell my flowfilterfield, what and how it has to filter?
if the structure of my program is correct, i would be glad, if anyone could tell me, what i have to do.
thanks in advance
0
Answers
-
I'm not sure I completely understood the problem, but first
If you look at another field like for example, Field 62: Sales (LCY)
In the Calcformula you will see:
Sum("Cust. Ledger Entry"."Profit (LCY)" WHERE (Customer No.=FIELD(No.),Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),Posting Date=FIELD(Date Filter),Currency Code=FIELD(Currency Filter)))
You need to do the same assignment...
To see the date filter and the change...
If you are on the form, and have revenue shown and you want to adjust the Date Filter, press Shift+F7 to access the flowfilters, and change the date.
If you are doing this in code, apply your filter to the Date Filter field and CALCFIELDS your revenue.-Lavin
"Profanity is the one language all programmers know best."0 -
How about customer card customer button->All Statistics->Sales
Should pull up form 351
Should give you sales n stuff for your choice of
1 day
1 week
1 month
1 quarter
1 year0 -
klavin wrote:If you are doing this in code, apply your filter to the Date Filter field and CALCFIELDS your revenue.
Thanks so far,
this is exactly what is missing.
I would write something like:
CustLedgEntries.Setrange("Posting Date", Calcdate(thisyear-1d+1d),today);
calcfields(revenue);
do i have to write it in onvalidate of the "date filter" of the customer table?
Or am I completely wrong?klavin wrote:I'm not sure I completely understood the problem, but first
If you look at another field like for example, Field 62: Sales (LCY)
In the Calcformula you will see:
Sum("Cust. Ledger Entry"."Profit (LCY)" WHERE (Customer No.=FIELD(No.),Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),Posting Date=FIELD(Date Filter),Currency Code=FIELD(Currency Filter)))
You need to do the same assignment...
To see the date filter and the change...
If you are on the form, and have revenue shown and you want to adjust the Date Filter, press Shift+F7 to access the flowfilters, and change the date.
If you are doing this in code, apply your filter to the Date Filter field and CALCFIELDS your revenue.0 -
CustLedgEntries.Setrange("Posting Date", Calcdate(thisyear-1d+1d),today);
calcfields(revenue);
do i have to write it in onvalidate of the "date filter" of the customer table?
Or am I completely wrong?
If you take a look at like an Aged Accounts Receivable report, you should see many examples of something like this:SETRANGE("Date Filter",0D,PeriodEndingDate[1]); CALCFIELDS("Net Change (LCY)");
From the Online Help in Navision:Example This example shows how to use the CALCFIELDS function to find the balance on December 31, 2003 and the net change for a customer in 2003: Customer.SETRANGE("Date Filter",010103D,123103D); Customer.CALCFIELDS(Balance, NetChange); The first line sets up a filter for the date filter field in the customer record. This field is a FlowFilter field which the system uses when it calculates some of the FlowFields in the customer record. The system then calculates the FlowFields in the second line.
Since the calcformula in the FlowField is using the Customer Ledger's Posting Date linking directly to the Customer Records "Date Filter", you need to Filter on "Date Filter" before you run your Calcfields.
The purpose of the flowfield is really so you aren't touching or declaring that other CustLedgeEntries, otherwise you could just repeat and loop through the records. Get what I mean? Hope it helps...
--Lavin-Lavin
"Profanity is the one language all programmers know best."0 -
Hi
got it. Thanks very much.
MiSta0
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