Hello @frederikdc I’m posting this here as it’s the same basic question, but with a more complicated twist, but my search led me here.
(Use case: VC and Private Equity)
Because of some end goals in reporting, I have a nuanced set of interrelated data.
4 Tables: Investments
, Financings
, Organizations
, Classifiers
Investments are the investments we make, Financings are about any transaction for which we have good data.
-
The table('Investments')
pulls the field('Into-Round')
from table('Financings')
via Linked
field type. This is a “has one” relationship. Example: “Baserow::IPO”
-
The table('Financings')
has the field('For-Organization')
, Linked
field type, and it pulls the primary-ID
field from table('Organizations')
. Also a “has one” relationship. Example: “Baserow”
-
The table('Organizations')
has the field('Has-Classifiers')
, Linked field type, which pulls in the primary-ID
field from table('Classifiers')
. This is a “has many” relationship. Example: “Database App”, “Small Data”, “API-First”, “Default Open-Source”. The table(‘Organizations’) should be the source of truth for the ‘Has-Classifiers’ property.
NOW here’s what I want to do:
In the table('Investments')
I want to pull in the field('Has-Classifiers')
from the table('Organizations')
without needing to duplicate the Organization
field in the Investments table, nor do I want a separate Linked field to the Classifiers table
. Otherwise it creates an extra data entry burden, and also can create different Has-Classifiers values across different tables.
So, this is either some kind of indirect 3-way lookup, or it could also be achieved with some kind of match function I’m not aware of.
So the query logic would follow something like:
On table('Investments')
the field('Into-Financing')
linked to table('Financings')
, fetch field('For-Organization')
, go to the Organization
row, and fetch the field('Has-Classifiers')
.
Example: Our Investment
into the Baserow::IPO
Financing
buys shares in the Organization
called Baserow, which has Classifiers
of “Database App”, “Small Data”, “API-First”, “Default Open-Source”
And might be a function in Baserow like:
lookup(lookup('Into-Financing', 'For-Organization'), 'Has-Classifiers')
In some kind of ORM it might read:
this.Has-Classifiers = this.Into-Financing.For-Organization.Has-Classifiers
Sorry to be obtuse and also to make such complications.