From your decription it sounds like you're sitting on a "company" record. Therefore, as you know, you Get ( RecordNumber ) for the company. Since you would (should) have youre employees and vehicles related to the company record you need to grab the number of related records. So (assuming Company::IDCompany > Employees::IDCompany and Employees::IDEmp) to get the count of related employee records you would want Count ( Employees::IDEmp ).
2nd Company of 45 companies
16 employees (for company 2)
44 vehicles (for company 2)
5th Company of 45 companies
87 employees (for company 5)
9 vehicles (for company 5)
If you have portals to the employees then you could add a count of what employee record is active in the portal.
1 of 1 people found this helpful
Which version are you using? In version 12, you can use the ExecuteSQL() function to get a list of companies sorted in any order, You can then compute the company's position in that list to get its ranking. It's a bit more complicated in previous versions, but still possible.
Note that the position of a company within the current found set is not necessarily the same as its overall rank within all companies in your table. IOW, the Get(RecordNumber) and Get(TotalRecordCount) functions are mutually incompatible, because they operate in two different contexts.
Please forget about using Get(RecordNumber) for this purpose or any key value you may use. In the long run it will cause you trouble and render your solution unusable.
Please read <http://fmdiff.com/fm/serialnumber.html> about why and what is the better solution.
Aha, yes! I am new to FileMaker and was not aware of the ExecuteSQL function.
I have now successfully used it to get a sorted list, but how would I compute the company's position?
P.S. I am using FMP 12 Pro Advanced.
The position of an item within a return-separated list of values can be calculated as =
ValueCount ( Left ( listOfValues ; Position ( ¶ & listOfValues & ¶ ; ¶ & item & ¶ ; 1 ; 1 ) ) )
It worked! Thank you!!