flowfield problem

JedrzejT
Member Posts: 267
Hi
I have two tables
1. "Employee"
"No.";"Fund. wage"
And
2. "Emp. Fund. wage"
"Date";"Emp No.";"Amount"
I want field "Fund. wage" in first table shows "Amount" from second table where Date is highest. and "emp no=no."
I think it is impossible but I better ask first
Thanks.
I have two tables
1. "Employee"
"No.";"Fund. wage"
And
2. "Emp. Fund. wage"
"Date";"Emp No.";"Amount"
I want field "Fund. wage" in first table shows "Amount" from second table where Date is highest. and "emp no=no."
I think it is impossible but I better ask first
Thanks.
0
Comments
-
Hmm... What about:
1) Extend "Employee" to include a "Fund. Wage Date" field, flowfield CalcFormula=MAX("Emp. Fund. wage".Date WHERE "Emp. No." = FIELD("No."))...
2) Now, Employee."Fund. wage" could be a flowfield CalcFormula=LOOKUP("Emp. Fund. wage".Amount WHERE "Emp. No." = FIELD("No.") AND "Date" = FIELD("Fund. Wage Date"))...
But, now the correctness of (2) depends on (1) being calculated first... Hmm...0 -
Hi there,
I will answer this on the basis that when you say that the Date is the "highest", you mean the latest?
I believe all you need to do is on the "Emp. Fund. Wage" table is set the primary key to be "Emp No.",Date. Then you make the "Fund. Wage" in the "Employee" table a flowfield, and the
CalcFormula=MAX("Emp. Fund. wage."Amount WHERE "Emp. No." = FIELD("No."))
By using MAX, it is finding the last Emp. Fund. wage entry based on the primary key (Which is Emp No and Date), but since the Employee number is restricted to the one Employee we are looking at, it should find the last Dated entry for that Employee.
In the case you wanted to find the earliest Dated entry for that Emp. Fund. wage, all you would need to do is change the MAX in the CalcFormula to MIN.
Hope this helps.0 -
Hi
Thanks for reply
Fb.. i think about it yesterday. Flowfield can't calculate formula based on the other flowfield
Knight
I have solution exactly like yours. It didn't work. This formula calculate Record where AMOUNT is highest . I think MAX depends on field (amount) , not on primary key.
Sorry for my english :?0
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