Help with relations

Hi Folks!

I have a table with people names (T1)
I have a table with people birthday (T2) - I know… could be at T1…
I have a table with year of graduation in Master and PhD (T3)

T2 have a reference column to names on T1
T3 have a reference column to names on T1

I need a {table, column) with how old a name get graduated on Master and PhD.

I can’t see how I can do it!

Any help will be appreciated.

Thanks in advance.

Assuming the reference columns in T2 and T3 are both called Person:

  1. Add a column Birthday to T1 with the formula T2.lookupOne(Person=rec).Birthday
  2. Add a column to T3 with the formula DATEDIF($Graduation_Date, $Person.Birthday, 'Y') to get the number of full years between the two dates. See Function reference - Grist Help Center for more info.

You could do this with just one formula in T3 combining the two, but having a birthday column in T1 should be useful anyway since as you said it’d be great to have these in the same table, and it should make it easier to understand what’s going on.

Also I’m assuming that a single person can appear multiple times in T3, which is why the final column is there, but if you only store one graduation per person then putting all the formulas in T1 would be fine.

1 Like

Brilliant! Thanks!

This tool is wonderful. I’m spreading the word!

2 Likes