Filter using a join (Notion)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

What I find after a few months of use as a real limitation: Joins are limited in various ways. Especially: You can't filter over a join

Example: Only include active projects in overviews

  • Er is een tabel Tasks, met -jawel- taken
  • Er is een tabel Categorieën, met bv. kaarten Zakelijk-omzet, Zakelijk-overhead, Privé
  • Er is een tabel Projecten, met bv. kaarten Klant xyz - Project Blah, Klant xyz - Project Flub en Renovatie22. Deze kaarten bevatten een veld Actief

Er is een simpele overzichts-view. Ik wil daar alleen projecten tonen die actief zijn. Dus waarvan de projecten de status Actief hebben. Zo ver ik kan nagaan, kan ik dat niet via een filter doen. Dit zou een join zijn die over twee tabellen gaat. Zoiets als

select
   tasks
join
   projects using task-id
where
   project-status = "Actief"   # ← I cannot filter over the joined table

Possible solutions

  • First create a view that includes both data sources, then have the filter over this view?
  • Include the field at the joined table in the base table, and have it updated whenever the field in the joined table gets updated - Bit messy, but a usual approach to such a limitation. This is the solution that was implemented in TaskAlot 3.0.

Sources