Forum Academy Marketplace Showcase Pricing Features

Advanced Filter on an Advanced Filter Help

Hello! I am really struggling with wrapping my mind around the logic of this filter.

I have an advanced filter where if the repeat # of a task is less than the number of instances of this task in already created schedules, it should return this task. If the task already occurs enough times in existing schedules, it will not return this task. I can’t seem to figure out how to write it, though.

Here in the screenshot, I have the advanced filter with these steps:
This task’s repeat # is less than “do a search for schedules that occur in this week: each items tasks”

Next, I need to essentially get the number of times this task occurs in that list and compare it with the repeat # in this filter. I thought maybe I could filter the list of tasks again, but I can’t pass the parent filter’s task into the child filter. So I’m wondering if it is possible to count only the number of instances where this filter’s task occurs in that list? I thought about grouping and aggregation, but I can’t seem to figure it out. All ideas welcome.

I have never been able to refer to an item within search within an advanced filter. This thing doesn’t get carried a level deeper.

Also, you might want to avoid this anyway as this would become really really heavy query.

Maybe create a field on “task” itself to hold number of instances created for that task and then use that value directly. You would of course need to update this count each time an instance is created, but it will be much simpler.

What I ended up doing was creating a field on task holding a list of schedules, then I could filter that. Thanks for your help!