# How to count a group of items

**URL:** <https://community.easymorph.com/t/how-to-count-a-group-of-items/5992>\
**Category:** General Q&A\
**Created:** [February 11, 2025, 9:27am UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992 "2025-02-11T09:27:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlo.nigro](https://community.easymorph.com/user_avatar/community.easymorph.com/carlo.nigro/32/3737_2.png) [@carlo.nigro](https://community.easymorph.com/u/carlo.nigro)\
**Post date:** [February 11, 2025, 9:27am UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992/1 "2025-02-11T09:27:06Z")

</div>

Hello everyone! I consider myself an expert and tested user of EasyMorph 🙂 but I have difficulty understanding and doing one thing.  
I have never understood how to count repetitions of a certain size with the tools available.  
I attach an example dataset:

 ![EM Dataset](https://community.easymorph.com/uploads/default/original/2X/e/e0fee2b623758b4a2d9f52cc187ca75fc1b4f6e7.png)

As you can see, I have a column obtained using the Running total tool, with "Target Column": Id, "Mode": Count and "Group Column": Id...  
I would expect that for each row of id, it would give me the count that I see above in the filters... instead I get a sort of Rank... Suggestions?

---

<div class="post-metadata">

**Author:** ![mattf](https://community.easymorph.com/user_avatar/community.easymorph.com/mattf/32/7015_2.png) [@mattf](https://community.easymorph.com/u/mattf)\
**Post date:** [February 11, 2025, 10:04am UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992/2 "2025-02-11T10:04:44Z")

</div>

Hi  
I'm not 100% sure I understand what you want to achieve. Are you trying to count the number of times a value appears in the column "Id"? Or do you want to add up column "c" grouped by column "Id"?

Either way, you can do this with the Aggregate action in EasyMorph.

Regards  
Matt

---

<div class="post-metadata">

**Author:** ![carlo.nigro](https://community.easymorph.com/user_avatar/community.easymorph.com/carlo.nigro/32/3737_2.png) [@carlo.nigro](https://community.easymorph.com/u/carlo.nigro)\
**Post date:** [February 12, 2025, 10:50am UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992/3 "2025-02-12T10:50:31Z")

</div>

Hi mattf,  
for example I would like that - for example - the first "Value" of Id that you see in the filter at the top, in my dataset appears in all its rows with the count "c" to 3 and not 1, 2, 3 depending on the record that I encounter first...

---

<div class="post-metadata">

**Author:** ![mattf](https://community.easymorph.com/user_avatar/community.easymorph.com/mattf/32/7015_2.png) [@mattf](https://community.easymorph.com/u/mattf)\
**Post date:** [February 12, 2025, 12:10pm UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992/4 "2025-02-12T12:10:13Z")

</div>

Ah, I think I understand now. You want to replace the value in column "c" with the maximum value for the same Id?

If so, you can do it as follows:

 ![image](https://community.easymorph.com/uploads/default/original/2X/9/9d6b877f8f2628e906ae8b5b78243ffee2cc7c0a.png)  
Firstly, derive a table from your input table and add an aggregation action to get the max "c" grouped by "Id". Then derive another table from the input table, and use the lookup action to map it in the max value. I've left the original "c" column and the new max one but you can drop and rename the columns as needed.

Regards  
Matt

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [February 12, 2025, 1:55pm UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992/5 "2025-02-12T13:55:30Z")

</div>

Alternatively, you can use the ["Totals/subtotals" action](https://help.easymorph.com/doku.php?id=transformations:subtotal). It creates a column with totals or group subtotals.

---

<div class="post-metadata">

**Author:** ![carlo.nigro](https://community.easymorph.com/user_avatar/community.easymorph.com/carlo.nigro/32/3737_2.png) [@carlo.nigro](https://community.easymorph.com/u/carlo.nigro)\
**Post date:** [February 14, 2025, 6:33pm UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992/6 "2025-02-14T18:33:08Z")

</div>

Thanks to both of you for your cooperation, I find that both methods can help me solve the problem in an excellent way! 🙂

---

<div class="post-metadata">

**Author:** ![mattf](https://community.easymorph.com/user_avatar/community.easymorph.com/mattf/32/7015_2.png) [@mattf](https://community.easymorph.com/u/mattf)\
**Post date:** [February 15, 2025, 2:09pm UTC](https://community.easymorph.com/t/how-to-count-a-group-of-items/5992/7 "2025-02-15T14:09:39Z")

</div>

Glad you got it working!
