calculate percent of 'completed' line records
kevindstanley
Member Posts: 11
I am trying to figure out how to use a flowfield to calculate percents of 'completed' records.
The table structure looks like the below
Table1 Header (key = No.)
-Table2 Lines (key =No., Line1)
--Table3 More Lines (key =No.,Line1,Line2)
"More Lines" has a field for status = status::completed
now Table2 "Lines" needs a field for percent complete. which would be calculated
"More Lines".SETRANGE on (No., Line1);
totalCount := "More Lines".COUNT
"More Lines".RESET;
"More Lines".SETRANGE on (No., Line1 and status::completed)
completedCount := "More Lines".COUNT;
percent := completedCount / totalCount;
Now this has to happen for the table header as well, but with the total records 'completed' on the Lines table. Is there any way to accomplish this with flowfields? I can't seem to do math at the table level on flowfields of that table. Any nudge in the right direction would be great.
Thanks
The table structure looks like the below
Table1 Header (key = No.)
-Table2 Lines (key =No., Line1)
--Table3 More Lines (key =No.,Line1,Line2)
"More Lines" has a field for status = status::completed
now Table2 "Lines" needs a field for percent complete. which would be calculated
"More Lines".SETRANGE on (No., Line1);
totalCount := "More Lines".COUNT
"More Lines".RESET;
"More Lines".SETRANGE on (No., Line1 and status::completed)
completedCount := "More Lines".COUNT;
percent := completedCount / totalCount;
Now this has to happen for the table header as well, but with the total records 'completed' on the Lines table. Is there any way to accomplish this with flowfields? I can't seem to do math at the table level on flowfields of that table. Any nudge in the right direction would be great.
Thanks
0
Comments
-
You can't create a flowfield for the PercentageComplete - you will need to create a function for this. The closest you can get is to have 2 flowfields - TotalLines and CompletedLines and then use them in your PercentageComplete function.0
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