# Show total amounts on reports by range

**URL:** <https://meta.discourse.org/t/show-total-amounts-on-reports-by-range/35024>\
**Category:** Feature\
**Created:** [2015年十月28日 17:15 UTC](https://meta.discourse.org/t/show-total-amounts-on-reports-by-range/35024 "2015-10-28T17:15:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)\
**Post date:** [2015年十月28日 17:15 UTC](https://meta.discourse.org/t/show-total-amounts-on-reports-by-range/35024/1 "2015-10-28T17:15:20Z")

</div>

Now I can export data from reports: posts, new users, etc..  
It’s cool! But it might be super-cool if Discourse shows a total amount by range selected since I can simply aggregate such data, for example new users/posts/topics by month  
Doing this using excel isn’t really handy

 ![](https://global.discourse-cdn.com/meta/original/3X/f/c/fc7cd203bb05ae8a8a686f637e7441058eb2858f.png)

---

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [2015年十月28日 17:21 UTC](https://meta.discourse.org/t/show-total-amounts-on-reports-by-range/35024/2 "2015-10-28T17:21:48Z")

</div>

Do you have any experience writing browser extensions?

I threw this together for Firefox but I imagine a Chrome extension would be similar

```plaintext
self.port.on('viewing_admin_reports_visits', function () {
"use strict";
	var visit_cells = document.querySelectorAll("table[class~='report'] tbody tr td");
	var h3_heading = document.querySelector("div#main-outlet h3");
	var visit_cells_len = visit_cells.length;

	var high_visit = 0;
	var high_visit_cell_num = 0;
	var total_count = 0;

	for (var i = 0; i < visit_cells_len; i++) {
		if (/[\d]{4}-[\d]{2}-[\d]{2}/.test(visit_cells[i].textContent)) {
			var ymd_date = new Date(visit_cells[i].textContent);
			if ( (ymd_date.getUTCDay() == 6) || (ymd_date.getUTCDay() == 0) ) {
				visit_cells[i].parentNode.setAttribute('style', "background-color: #efefff");
			}
		}
		if (/\s[\d]+\s/.test(visit_cells[i].textContent)) {
			total_count += parseInt(visit_cells[i].textContent);
			if (parseInt(visit_cells[i].textContent) > high_visit) {
				high_visit = parseInt(visit_cells[i].textContent);
				high_visit_cell_num = i;
			}
		}
	}
	visit_cells[high_visit_cell_num].setAttribute('style', "font-weight: bold; font-size: 1.2em");

	var avg_span = document.createElement('span');
	avg_span.textContent = " - average " + Math.round(total_count / (visit_cells_len / 2) ) + " per day";
	h3_heading.appendChild(avg_span);
});

```

---

<div class="post-metadata">

**Author:** ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)\
**Post date:** [2015年十月29日 08:35 UTC](https://meta.discourse.org/t/show-total-amounts-on-reports-by-range/35024/3 "2015-10-29T08:35:20Z")

</div>

mmh I could try 🙂 thanks..

---

<div class="post-metadata">

**Author:** ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)\
**Post date:** [2025年十二月4日 11:37 UTC](https://meta.discourse.org/t/show-total-amounts-on-reports-by-range/35024/4 "2025-12-04T11:37:05Z")

</div>


