February 22, 20223 yr I'm building a maintenance scheduling & tracking solution and am trying to create a field, which will calculate the date from the most recent entry into a related, LINE ITEMS table. If I sort the related table by date descending, the following calculation works, as I've used it in other solutions: GetNthRecord ( LINE_ITEMS::date ; 1 ) In this case, I'd like to filter the results by another field in the related LINE_ITEMS table. For example, I'm going to have a text field, which contains a value from a list - MONTHLY, QUARTERLY, ANNUAL. In the parent table, I'd like to have three calculation fields (one for each value), and obtain the (separate) most recent entry for MONTHLY, QUARTERLY, ANNUAL. Do I need to have three, separate related tables, or can this be done via calculation "filter"?
February 22, 20223 yr If this is for display only, you could use 3 one-row portals, each filtered to show a specific type. Otherwise it gets more complicated. --- BTW, instead of sorting the relationship and getting the value from the 1st record, you could have used simply: Max ( LINE_ITEMS::date ) or (assuming the records are entered in chronological order): Last ( LINE_ITEMS::date ) Note also that: GetNthRecord ( LINE_ITEMS::date ; 1 ) can be written simply as: LINE_ITEMS::date since a reference to a related field always gets data from the 1st related record.
Create an account or sign in to comment