calculate percent of 'completed' line records

kevindstanleykevindstanley Member Posts: 11
edited 2014-06-10 in NAV Three Tier
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

Comments

  • KishormKishorm Member Posts: 921
    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.
Sign In or Register to comment.