Looping a HubL filter

Does anyone know a way how to loop a filter? Is it even possible?

I’ve been tasked with building an internal dashboard for my employer to show a variety of data from 30+ locations.

Each filter is complex, but essentially only has a couple of items changed (basic example below). Instead of hardcoding each filter, is it possible to loop it within the module so new filters can be added or removed within the page editor?

{% set filter_london = table | selectattr ("city.name","equalto","London") | rejectattr ("plot_status.name","equalto","Reserved") %}

{% set filter_manchester = table | selectattr ("site.name","equalto","Manchester") | rejectattr ("plot_status.name","equalto","Reserved") %}

{% set filter_glasgow = table | selectattr ("city.name","equalto","Glasgow") | rejectattr ("plot_status.name","equalto","Reserved") %}

Hello @ben-duchy ,

of course it is possible :slightly_smiling_face:

as my solution I would like to link two pages where you will definitely find a solution to your case.
Click here for the filters supported by HubL. You might want to use one.

Click here for the loops.
And for your case I think you will need this loop.

Click here

I hope I could help, best regards,

Özcan

Perfect, thank you @Oezcan