# How to count a list within the newest thing

**URL:** <https://forum.bubble.io/t/how-to-count-a-list-within-the-newest-thing/174683>\
**Category:** Need help\
**Created:** [October 20, 2021, 5:53pm UTC](https://forum.bubble.io/t/how-to-count-a-list-within-the-newest-thing/174683 "2021-10-20T17:53:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesP](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@JamesP](https://forum.bubble.io/u/JamesP)\
**Post date:** [October 20, 2021, 5:53pm UTC](https://forum.bubble.io/t/how-to-count-a-list-within-the-newest-thing/174683/1 "2021-10-20T17:53:11Z")

</div>

Hi everyone,

I have some Types called `League`, `Seasons` and `Games`  
a `League` contains a field with `Seasons` and `Seasons` contain `Games`  
`Games` have a `Date Played` field that is either blank if they have not yet been played or has a date if the game has been played.

I have created a repeating group that contains a list of leagues and one of the metrics I want to display is how many games have been played in the latest season (latest will have the newest creation date).

I cant figure out how to form the dynamic data to do this. Can someone help, please?

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [October 20, 2021, 6:10pm UTC](https://forum.bubble.io/t/how-to-count-a-list-within-the-newest-thing/174683/2 "2021-10-20T18:10:49Z")

</div>

Hi there, @JamesP… I’m not sure how performant it will be, but I put together a quick example, and if I understand your post correctly, the following expression seems to produce the desired result.

 ![games](https://us1.discourse-cdn.com/bubble/original/3X/b/8/b86bfd17e13d1fdb13bf1bff164a378177a62b78.png)

Want to give something like that a shot?

Hope this helps.

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![JamesP](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@JamesP](https://forum.bubble.io/u/JamesP)\
**Post date:** [October 20, 2021, 6:52pm UTC](https://forum.bubble.io/t/how-to-count-a-list-within-the-newest-thing/174683/3 "2021-10-20T18:52:40Z")

</div>

Thanks Again for your help.  
It’s close and really gave me the info I needed to work it out.  
Here’s what I ended up with:  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/9/6/9654cab874e1dd18550dc15c92947e6de9a9873e.png)

Basically it needed a sort before taking the last item

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [December 29, 2021, 5:53pm UTC](https://forum.bubble.io/t/how-to-count-a-list-within-the-newest-thing/174683/4 "2021-12-29T17:53:36Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
