Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using the "max" function to access a record ?

Featured Replies

Hi all,

Quick question:

Suppose we use the Max() function to get the highest date stamp within a table.

Now ... once we have found the highest date how can I get the ID of the record that contains this date ? ... and then use this ID to access a sister field in that same record ?

(P.S. I do not wish to add a mirror table in the graph and do this via relationships)

Hi Thomas,

Why not use the max function to set a variable(global in v 7), then use the variable as search criteria to find the record?

Like so:

set(globalfield; Max(Field))

enter find mode

Set(Field; globalfield)

perform find

HTH

Tim

Why not use the Last() function to get directly to any field in the last record?

  • Author

Hi Tim,

Thank you for your comment !

The reason I am not doing it that way is because it is needed as a calculation for the entire table.

-There is a main table called "Product Catalog"

-Product catalog is related to "Price archives" (Each record in "product catalog" has a history of all price changes done to that product) ... the most recent change is the "current" price.

-Now, there is a calculation field in "Product Catalog" that keeps the "latest price change date" for each record.

-So, we would like to have a second calculation field that fetches the "latest price", based on the "latest date" (the latest price field is later referenced by other tables)

(It is already done right now by creating a mirror "priceArchive" table and use a relationship to peg the latest record based on date and product_ID). The thing is, that being a minimalist, I would like to see if there are more elegant ways of achieving this; other than cluttering the graph with mirror tables

  • Author

Why not use the Last() function to get directly to any field in the last record?

wow !!

I really need to look into this function (didn't know about it)

EDIT: Success ! All I had to do is use a sorted (by date) relationship for the "priceArchives" table and then use the last() function.

This is it. Thank you for teaching me something new.

Best,

Thomas

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.