Template 'count' challenge

Hi,
I have a sensor with an attribute containing below dates.
How can I count the number of dates for s specific date? I would like to get the first and last value of that count.
Example of below, for 2022/10/11, I would like to know first appearance (11) and count (7) or last appearance (17).
Why? I have other attributes from which I want to collect their values.
I was hoping to get something like {{ state_attr(‘sensor.xyz’, ‘date’) | ‘2022/10/11’ | count }} but obviously that does not work :slight_smile:

date:
  - 2022/10/07
  - 2022/10/07
  - 2022/10/07
  - 2022/10/07
  - 2022/10/07
  - 2022/10/10
  - 2022/10/10
  - 2022/10/10
  - 2022/10/10
  - 2022/10/10
  - 2022/10/10
  - 2022/10/11
  - 2022/10/11
  - 2022/10/11
  - 2022/10/11
  - 2022/10/11
  - 2022/10/11
  - 2022/10/11
  - 2022/10/12
  - 2022/10/12
  - 2022/10/12
  - 2022/10/12
  - 2022/10/13
  - 2022/10/13
  - 2022/10/13
  - 2022/10/13
  - 2022/10/13
  - 2022/10/13
  - 2022/10/13
  - 2022/10/13