# Como usar médias em gráficos

**URL:** <https://community.glideapps.com/t/como-usar-medias-em-graficos/62823>\
**Category:** Ask for Help\
**Created:** [June 16, 2023, 2:42am UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823 "2023-06-16T02:42:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leocadio\_Neto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/leocadio_neto/32/32986_2.png) [@Leocadio\_Neto](https://community.glideapps.com/u/Leocadio_Neto)\
**Post date:** [June 16, 2023, 2:42am UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823/1 "2023-06-16T02:42:14Z")

</div>

Olá parceiros!

Gostaria de saber como usar médias em gráficos no glide pages.

Eu tenho um tabela que possui notas de avaliacao de qualidade de funcionarios.

Montei um gráfico que é exibido no perfil de cada usuario que mostra a sua nota por semana.

Acontece que essa nota está sendo somada e não em média.

Como resolvo isso?

\*Considere que em uma mesma semana determinado funcionário pode ter mais de uma avaliação.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 16, 2023, 11:28pm UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823/2 "2023-06-16T23:28:35Z")

</div>

I assume you have an external table to store quality assessment scores with a structure like this:

Employee ID - Date of Assessment - Score

What I would do is:

- Create a math column to determine the numerical value of the week. It can look like this:

YEAR(D)\*100+WEEKNUM(D) with D being the date of assessment.

- Create a query column, pointing at the same table, filter by employee ID is this row \> employee ID and weeknum equals to this row \> week num.

- Create a rollup column to get the average number from that relation.

- Add a rowID column if you haven’t.

- Create a single value column to get the first rowID from the query column.

- Go back to your Users table. Add a chart based on the relation from the Users table to the Assessment table, filter the rows to show by rowID equals the single value above (act as a unique function), and show the average number.

- You might want to add a few steps to determine the start and end dates of the week to show as labels on the X axis.

---

<div class="post-metadata">

**Author:** ![Leocadio\_Neto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/leocadio_neto/32/32986_2.png) [@Leocadio\_Neto](https://community.glideapps.com/u/Leocadio_Neto)\
**Post date:** [June 30, 2023, 10:37pm UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823/3 "2023-06-30T22:37:03Z")

</div>

Para que isso funcuone, eu preciso fazer na tabela de usuarios?

Porque no meu app eu tenho uma tabela de funcionários que não fazem login e a tabela de usuarios.

Fiquei um pouco confuso.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 1, 2023, 12:40am UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823/4 "2023-07-01T00:40:36Z")

</div>

You can move the logic to the Employees table, and show the chart in each employee’s details screen. This is assuming you are storing quality assessment scores for employees.

---

<div class="post-metadata">

**Author:** ![Leocadio\_Neto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/leocadio_neto/32/32986_2.png) [@Leocadio\_Neto](https://community.glideapps.com/u/Leocadio_Neto)\
**Post date:** [July 3, 2023, 2:47am UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823/5 "2023-07-03T02:47:09Z")

</div>

Funcionou! Sensacional! Muito Obrigado!!!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 3, 2023, 11:56pm UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823/6 "2023-07-03T23:56:41Z")

</div>

Great to hear!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [July 4, 2023, 11:56pm UTC](https://community.glideapps.com/t/como-usar-medias-em-graficos/62823/7 "2023-07-04T23:56:42Z")

</div>

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