In each formula, the content of the second set is the completed work: so you might get the “complementary” part. In that case, to avoid duplicate calculations, one column should refer to the other. So the definitions become:
in Clients table:
Blogs with articles:
Posts.lookupRecords(
Clients=CONTAINS($id)
).Blog
Blogs without articles:
set(Blogs.all) - set($Blogs_with_articles)
in Blogs table:
Clients with articles:
(
client
for clients in Posts.lookupRecords(Blog=$id).Clients
for client in clients
)
Clients without articles:
set(Clients.all) - set($Clients_with_articles)
I have updated the sample, and added permissions so that you might use it as a starting point for a new one by clicking on the share button at the top.
N. B. : The “Code View” at the bottom left gives a very useful and synthetic view of the logic of a document.
@jperon Also, what if I wanted to only include blogs who have a “Use” toggle that is TRUE. That is, filtering for blogs that we are currently using and ignore one that we are not currently using.
Sorry, I had forgotten about the formulas. It’s fixed, and moreover I added set(…) to the with_ columns to avoid duplicate names. To fix it, I replaced Blogs.all by Blogs.lookupRecords(Use=True) and so on, and added an if clause to list comprehensions.