# How can I create a class ratio using aggregate?

**URL:** <https://cl.desmos.com/t/how-can-i-create-a-class-ratio-using-aggregate/5224>\
**Category:** Questions\
**Tags:** aggregate\
**Created:** [November 10, 2023, 5:43pm UTC](https://cl.desmos.com/t/how-can-i-create-a-class-ratio-using-aggregate/5224 "2023-11-10T17:43:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![torrence\_t](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@torrence\_t](https://cl.desmos.com/u/torrence_t)\
**Post date:** [November 10, 2023, 5:43pm UTC](https://cl.desmos.com/t/how-can-i-create-a-class-ratio-using-aggregate/5224/1 "2023-11-10T17:43:04Z")

</div>

I am trying to create a class proportion of the number of “wins.” I don’t need to create a dotplot or a table - I can get the number of wins each student made, but then how to I get the proportion for the whole class?

---

<div class="post-metadata">

**Author:** ![ianmcmeek](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ianmcmeek/32/3966_2.png) [@ianmcmeek](https://cl.desmos.com/u/ianmcmeek)\
**Post date:** [November 14, 2023, 3:29pm UTC](https://cl.desmos.com/t/how-can-i-create-a-class-ratio-using-aggregate/5224/2 "2023-11-14T15:29:04Z")

</div>

Hi Tamara, are you familiar with using `aggregate` in CL ([link to documentation](https://teacher.desmos.com/computation-layer/documentation#aggregate))? This should enable you to put together each student’s data to find the overall proportion. I’m happy to put together a demonstration of how it might look if that would be helpful - let me know!

---

<div class="post-metadata">

**Author:** ![torrence\_t](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@torrence\_t](https://cl.desmos.com/u/torrence_t)\
**Post date:** [November 14, 2023, 6:10pm UTC](https://cl.desmos.com/t/how-can-i-create-a-class-ratio-using-aggregate/5224/3 "2023-11-14T18:10:22Z")

</div>

Thank you. In the end, this is what I did. There is likely a more elegant way, but this will work.

> **[Can you get a pair of Aces or a Pair of Kings? • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/654d87f408f19c114e5f8217)**
>
> by Tamara Torrence

---

<div class="post-metadata">

**Author:** ![ianmcmeek](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ianmcmeek/32/3966_2.png) [@ianmcmeek](https://cl.desmos.com/u/ianmcmeek)\
**Post date:** [November 15, 2023, 12:57pm UTC](https://cl.desmos.com/t/how-can-i-create-a-class-ratio-using-aggregate/5224/4 "2023-11-15T12:57:52Z")

</div>

That gets the job done, nice! I’m not sure if it was intentional to do the two aggregate calculations in separate graphs, but it is also an option to put them both in the same graph.
