# Ermitteln Sie die Gesamtmitgliederzahl pro Monat mit Data Explorer

**URL:** <https://meta.discourse.org/t/get-member-count-overall-by-month-using-data-explorer/178899>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [8. Februar 2021 um 14:29 UTC](https://meta.discourse.org/t/get-member-count-overall-by-month-using-data-explorer/178899 "2021-02-08T14:29:43Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)\
**Post date:** [10. Februar 2021 um 14:29 UTC](https://meta.discourse.org/t/get-member-count-overall-by-month-using-data-explorer/178899/7 "2021-02-10T14:29:54Z")

</div>

Ich hoffe, das hilft.

```sql
WITH data_month AS (
    SELECT 
        date_part('year', created_at) AS year, 
        date_part('month', created_at) AS month,
        COUNT(*) AS "new_users_month"
    FROM users
    GROUP BY date_part('year', created_at), date_part('month', created_at)
    ORDER BY date_part('year', created_at) ASC, date_part('month', created_at)
)

SELECT
  year, 
  month, 
  new_users_month,
  SUM(new_users_month) over (ORDER BY year, month rows between unbounded preceding AND current row) AS total
FROM data_month ORDER BY year, month

```

| year | month | new\_users\_month | total |
| --- | --- | --- | --- |
| 2020 | 2 | 50 | 50 |
| 2020 | 3 | 100 | 150 |
| 2020 | 4 | 50 | 200 |

---

_[View the full topic](https://meta.discourse.org/t/get-member-count-overall-by-month-using-data-explorer/178899)._
