# Need help calculating weekly averages using either TSVB tables or Scripted fields

**URL:** https://discuss.elastic.co/t/need-help-calculating-weekly-averages-using-either-tsvb-tables-or-scripted-fields/271472
**Category:** Kibana
**Created:** [April 28, 2021, 7:13am UTC](https://discuss.elastic.co/t/need-help-calculating-weekly-averages-using-either-tsvb-tables-or-scripted-fields/271472 "2021-04-28T07:13:07Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)
#### Post date: [April 29, 2021, 11:09am UTC](https://discuss.elastic.co/t/need-help-calculating-weekly-averages-using-either-tsvb-tables-or-scripted-fields/271472/6 "2021-04-29T11:09:11Z")

</div>

> As an enhancement to this, would it be possible to generate an average for the past 7 days for each and every date?

For such visualizations, you should use TSVB (Moving average aggregation) ,  
example: [Moving Average Visualization - #2 by nickpeihl](https://discuss.elastic.co/t/moving-average-visualization/217793/2)

---

_[View the full topic](https://discuss.elastic.co/t/need-help-calculating-weekly-averages-using-either-tsvb-tables-or-scripted-fields/271472)._
