Creating this use case is simple, and it can be achieved even without using Jinja. All you need are 2 aggregates and one filter. The first aggregate will count the most common property values of a specific event in your desired number of days:
This aggregate will save and display the value that is tracked most of the time in each customer profile. You can work further with that by creating another aggregate that will be responsible for counting events that contain the most common property value:
We simply count the number of events with the value of the first aggregate, which is the most common value.
In order to filter customers based on this, we can create a simple condition:
This condition will filter all customers that have more than 3 example events with the same value in the index property in the last 7 days (as per date filtering in the aggregates). You can also use Jinja for the filtering if you need more flexibility
{% if aggregates['<aggregateID>'] > 3 %}
True
{% else %}
False
{% endif %}