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.

Newest Value from Portal in Base Table

Featured Replies

I'm sure this is an easy one... I just can't wrap my head around it:

I have a portal to track the value history of a piece of artwork. Artwork being the Base Table, linked via record id to the table containing all the values entered over time. Simple.

How can I get the most recent value (date = key-field) to flow into a field in the Base Table? The idea is to be able to display the value or the artwork in the list view of the Base Table.

Can anyone help? Thank you so much!

Michael

Well beyond using a real values as key, should be restrained to filtered portals, does following come to mind:

http://www.filemaker.com/help/Functions%20Ref5.html

http://www.filemaker.com/help/FunctionsRef-339.html

There are more ways to skin it, but let's leave it here for now!

--sd

  • Author

Thank you for your quick reply, Søren!

The problem with Max(values::field) is that it returns the largest value (which is not necessarily the latest one: the artwork could loose value over time)

The problem with Last(values::field) is that the user might want to complete the value history of an artwork: if he enters an appraisal he had missed from a year ago, according to FM that one is the "last one", which is not useful.

That's why I thought I had to link it to the date field in values somehow, but couldn't figure out how to make that work.

Edited by Guest

Another option is to List( all the recordKeys in the related table and

LeftValues(myList;ValueCount(myList)-1)

...and relate it via a non equal relation. I would in your case, start swearing or other noises - over the blunder it is to have forgotten a recordID in every single of the tables.

If you relation is set up sorted double the TO and make a new one sans the sortorder and aggregate the List( over it.

But suddenly does both Last( and Max( begin to make more sense again, but all of them are overkill.

Since an unstored calc, over a reversely sorted relation pulling the first related value will always get the ID of the latest, if it's needed at all.

If you just need to show an image use an extra TO reverse the creation order in the relations def and show the image without a portal.

--sd

If you sort the related records by date ascending (in the relationship's definition), Last() will get you data from the latest related record. If you sort by date descending, you can place the related field/s directly on the parent layout - it will always show data from the first related record, which is the latest record.

EDIT:

Alternatively, if you don't want to sort the relationship (and don't want to create a duplicate relationship just for this), you can place a one-row portal on the parent layout, and sort the portal by date descending.

Edited by Guest

  • Author

Awesome, "comment"!

Your answer so simple and powerful. Exactly what I needed...

Edited by Guest

Your answer so simple and powerful. Exactly what I needed...

Yes, I can only envy the conciseness, he manages to get away with. I said the same, or rather intended to do so :crazy2:

However do I hope I can beat him with his danish skills.

--sd

I hope I can beat him with his danish skills.

It depends: are we talking about speaking it or eating it?

If you eat is it not danish but "Wienerbrød" but the lard it's made of is neither kosher nor the dietists first recommendation. You're likely to get pimples on your backside, if you doesn't restrain yourself.

--sd

  • Author

Haha, you guys are funny!

I appreciate the help of both of you. I have to admit though, I just had a hard time figuring out WHAT you were telling me to do Søren - language barrier...

Nice try, but trash-talking won't help you - bring it on!

It's funny, BTW, that the Danish call it Viennese bread(?)

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.