0vote

How can I filter rollups to show only the most recently created record?

Hi!

I’m trying to create a rollup property that displays only the most recent Status from a related objects (could be more than one objects - I want to display only the last object status). What’s the best way to achieve this? Any guidance would be greatly appreciated!

Thanks in advance!

2 Answers

1vote

thomas_yang Points3790

If you want to get specific property out of your children database then you should use the formula property.

You can manipulate the order the children show up through reverse() and first()

Here's a short video on how you can do that:
https://youtu.be/vsSAsC2qRTU

0vote

freelancerops Points460

Rollups can only aggregate (count, sum, min/max, show original), so for "latest status" use a formula on the parent database instead. Steps:

  1. Make sure the child database has a Created time property (or a Date property if you care about the event date rather than when the row was made). Notion's built-in "Created time" works.
  2. Make sure the two databases are connected by a relation (e.g. Projects <-> Updates). Optionally add a rollup of Status from the child just for reference.
  3. In the parent database add a Formula property "Latest Status":
prop("Updates").sort(current.prop("Created time")).last().prop("Status")

(Use .sort(...) with the date property name you actually have, and swap .last() for .first() if you sort descending with .sort(current.prop("Created time")).reverse().) Replace "Updates", "Created time" and "Status" with your own property names.

  1. If the formula errors on empty relations, wrap it: if(empty(prop("Updates")), "", ...).
  2. If Status is a Status/Select property, the formula returns its text, so you can show it in a table or board view. For colours, use a second formula that maps text to an emoji, e.g. ifs(prop("Latest Status")=="Done","",prop("Latest Status")=="In progress","","⚪").

Note: if your child rows can be edited later, "Created time" won't change, so use "Last edited time" or a manual Date if you want "most recently updated" instead.

If it helps, I made a free starter template with this setup: https://2rds.github.io/freelancer-ops/lite.html?ref=notionanswers

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect