# Aantal onderwerpen in een categorie

**URL:** https://meta.discourse.org/t/number-of-topics-in-a-category/163952
**Category:** Support
**Created:** [14 september 2020 om 11:20 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952 "2020-09-14T11:20:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tpetrov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tpetrov/32/164643_2.png) [@tpetrov](https://meta.discourse.org/u/tpetrov)
#### Post date: [14 september 2020 om 11:20 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952/1 "2020-09-14T11:20:49Z")

</div>

How can I see how many topics a category consist of?

---

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [14 september 2020 om 11:40 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952/2 "2020-09-14T11:40:23Z")

</div>

Hey Toni,

Does this [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query work for your needs? It will show you a count of topics and posts in each category:

![image](https://global.discourse-cdn.com/meta/original/3X/2/6/26c76ecbb8dfa5cd5c1bd8c22c3aac9adca7194b.png)

```plaintext
SELECT category_id, 
       stats.topic_count, 
       stats.post_count 
FROM categories ccc 
       LEFT JOIN (SELECT topics.category_id, 
                         Count(*) topic_count,
                         SUM(topics.posts_count) post_count
                         FROM topics 
                          
                  WHERE ( "topics"."deleted_at" IS NULL ) 
                         AND ( topics.id NOT IN (SELECT cc.topic_id 
                                                 FROM categories cc 
                                                 WHERE topic_id IS NOT NULL) ) 
                         AND "topics"."visible" = true 
                  GROUP BY topics.category_id 
                        ) stats 
              ON stats.category_id = ccc.id

```

---

<div class="post-metadata">

### Author: ![tpetrov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tpetrov/32/164643_2.png) [@tpetrov](https://meta.discourse.org/u/tpetrov)
#### Post date: [14 september 2020 om 16:37 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952/4 "2020-09-14T16:37:12Z")

</div>

Awesome, thanks @rishabh

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [18 september 2020 om 21:26 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952/5 "2020-09-18T21:26:34Z")

</div>

Isn’t this possible by visiting the categories page? [Categories - Discourse Meta](https://meta.discourse.org/categories)

---

<div class="post-metadata">

### Author: ![tpetrov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tpetrov/32/164643_2.png) [@tpetrov](https://meta.discourse.org/u/tpetrov)
#### Post date: [19 september 2020 om 09:48 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952/7 "2020-09-19T09:48:05Z")

</div>

Yeah, it is. I don’t know how I missed that.

---

<div class="post-metadata">

### Author: ![tpetrov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tpetrov/32/164643_2.png) [@tpetrov](https://meta.discourse.org/u/tpetrov)
#### Post date: [20 september 2020 om 17:33 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952/8 "2020-09-20T17:33:35Z")

</div>

> [@tpetrov](#):
>
> I don’t know how I missed that.

Now I know - it shows it on meta, but not on our community since we are using the boxes layout (and it doesn’t have the count apparently)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [20 oktober 2020 om 17:47 UTC](https://meta.discourse.org/t/number-of-topics-in-a-category/163952/9 "2020-10-20T17:47:49Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
