# Inputing data in to different gauges on for each day of the week

**URL:** <https://discourse.nodered.org/t/inputing-data-in-to-different-gauges-on-for-each-day-of-the-week/90704>\
**Category:** Dashboard\
**Created:** [4 September 2024 11:59 UTC](https://discourse.nodered.org/t/inputing-data-in-to-different-gauges-on-for-each-day-of-the-week/90704 "2024-09-04T11:59:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [4 September 2024 13:03 UTC](https://discourse.nodered.org/t/inputing-data-in-to-different-gauges-on-for-each-day-of-the-week/90704/2 "2024-09-04T13:03:22Z")

</div>

Save your counts as an array of 7 elements. You can use a context variable for this.

A function node like this should work to maintain the counts

```auto
const day = new Date().getDay() // sunday - 0, saturday = 6
let daycounts = context.get("daycounts") || [0,0,0,0,0,0,0] // Hold counters as an array
daycounts[day] ++ // Increment today's counter
context.set("daycounts", daycounts) // save it
msg.payload = daycounts
return msg;

```

And a node-red-dashboard gauge can be set to display eg Wednesday's count like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/c/ac11c4cc99684afcace941412e5146f49949c74d.png)

---

_[View the full topic](https://discourse.nodered.org/t/inputing-data-in-to-different-gauges-on-for-each-day-of-the-week/90704)._
