Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6424 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted (edited)

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
Posted

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

Posted (edited)

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
Posted (edited)

Awesome, "comment"!

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

Edited by Guest
Posted

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

Posted

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

Posted

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...

This topic is 6424 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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