# Data Time Series Node

**URL:** <https://forums.losant.com/t/data-time-series-node/1068>\
**Category:** Help\
**Tags:** dashboard, losant-api\
**Created:** [August 14, 2018, 12:34am UTC](https://forums.losant.com/t/data-time-series-node/1068 "2018-08-14T00:34:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![rwild\_node](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@rwild\_node](https://forums.losant.com/u/rwild_node)\
**Post date:** [August 14, 2018, 12:34am UTC](https://forums.losant.com/t/data-time-series-node/1068/1 "2018-08-14T00:34:12Z")

</div>

I’m trying to use the time series node to collect data from a device over a custom time range. I have the aggregation set to ‘sum’ and the resolution set to 24 hours. From what I can tell using this resolution defaults the 24 hour summation period from midnight to midnight GMT. Is there any way to manipulate this query such that the summation of data for a 24 hour period is aligned with the local timezone? I had tried setting the ‘range end’ to midnight local time but didn’t seem to work either.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [August 14, 2018, 4:24pm UTC](https://forums.losant.com/t/data-time-series-node/1068/2 "2018-08-14T16:24:33Z")

</div>

There is currently not a way to change the bucket windows. As you noticed, they are currently based on GMT. I’ve added a ticket for us to investigate ways to support more custom bucket times.

---

<div class="post-metadata">

**Author:** ![rwild\_node](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@rwild\_node](https://forums.losant.com/u/rwild_node)\
**Post date:** [August 14, 2018, 6:38pm UTC](https://forums.losant.com/t/data-time-series-node/1068/3 "2018-08-14T18:38:31Z")

</div>

Thanks for the update Brandon, essentially we build reports for our users by exporting the data to a TP api which builds the reports. We have a clunky workaround at the moment which isn’t ideal. Being able to apply custom bucket times before we export the data would be a huge help. I guess the workaround for the time being would be to loop over a 24 hour period with n= number of days? Any other suggestions would be much appreciated.

---

<div class="post-metadata">

**Author:** ![Hugo\_Hernan\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hugo\_Hernan\_Ruiz](https://forums.losant.com/u/Hugo_Hernan_Ruiz)\
**Post date:** [February 25, 2019, 3:47pm UTC](https://forums.losant.com/t/data-time-series-node/1068/4 "2019-02-25T15:47:05Z")

</div>

Hi! I need your help please… … how can I graph the current value and the average of the last 10 readings at the same time? Tks a lot!

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [February 25, 2019, 4:44pm UTC](https://forums.losant.com/t/data-time-series-node/1068/5 "2019-02-25T16:44:51Z")

</div>

Hi @Hugo_Hernan_Ruiz,

One way to accomplish this is to use the Losant API node within a workflow, and add an attribute to a device to store the average.

First, add an attribute to your device to hold the average value. Then within your workflow you can use the [Losant API node](https://docs.losant.com/workflows/data/losant-api/) to get the last ten state values of a device.

 ![45%20AM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/e/e8a21e7a701ec88d5ffe48dca03a9998da94d6f7.png)

Loop through those values and average them, then set that averaged value to your new device attribute.

 ![19%20AM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/2500fdd84e63fce8e6a1512cc98426ebf04c30da.png)

You will then be able to compare and graph the two values simultaneously.

Hopefully this helps!  
Julia

---

<div class="post-metadata">

**Author:** ![Hugo\_Hernan\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hugo\_Hernan\_Ruiz](https://forums.losant.com/u/Hugo_Hernan_Ruiz)\
**Post date:** [February 25, 2019, 8:18pm UTC](https://forums.losant.com/t/data-time-series-node/1068/6 "2019-02-25T20:18:34Z")

</div>

Thanks for your support Julia!, the proposed solution works perfectly.

---

<div class="post-metadata">

**Author:** ![Hugo\_Hernan\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hugo\_Hernan\_Ruiz](https://forums.losant.com/u/Hugo_Hernan_Ruiz)\
**Post date:** [March 4, 2019, 3:33pm UTC](https://forums.losant.com/t/data-time-series-node/1068/7 "2019-03-04T15:33:09Z")

</div>

Hi Julia, I have a question: what is the limit of the Losant API? Can I include 1000 as a parameter?

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [March 4, 2019, 4:38pm UTC](https://forums.losant.com/t/data-time-series-node/1068/8 "2019-03-04T16:38:30Z")

</div>

Hi @Hugo_Hernan_Ruiz,

There is not a number limit on past states for Device: Get State in the Losant API node; you can set the limit to 1000. Note that as the limit value gets larger, you may run into some runtime issues with your workflows.

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Jules\_Huguenin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/jules_huguenin/32/4031_2.png) [@Jules\_Huguenin](https://forums.losant.com/u/Jules_Huguenin)\
**Post date:** [October 19, 2020, 6:54pm UTC](https://forums.losant.com/t/data-time-series-node/1068/9 "2020-10-19T18:54:09Z")

</div>

Hi @Brandon_Cannaday,  
Bouncing back on @rwild_node’s issue, I’m in the same situation as I’m trying to sum data for one day only, local time.  
Any update since 2018?

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [November 17, 2020, 11:56pm UTC](https://forums.losant.com/t/data-time-series-node/1068/10 "2020-11-17T23:56:43Z")

</div>

Can you clarify what you mean by “one day only”?

Are you just trying to get a single data point, which is the sum of all points collected over a 24 hour period (in local time)?

---

<div class="post-metadata">

**Author:** ![Jules\_Huguenin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/jules_huguenin/32/4031_2.png) [@Jules\_Huguenin](https://forums.losant.com/u/Jules_Huguenin)\
**Post date:** [November 23, 2020, 3:28am UTC](https://forums.losant.com/t/data-time-series-node/1068/11 "2020-11-23T03:28:15Z")

</div>

Correct, I’m trying to get a single data point, collected from midnight to midnight, local time.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [November 23, 2020, 8:18pm UTC](https://forums.losant.com/t/data-time-series-node/1068/12 "2020-11-23T20:18:10Z")

</div>

For a single data point, you can use the [Date/Time Node](https://docs.losant.com/workflows/logic/date-time/), which is new since this topic was originally created, to find “midnight” for any Timezone:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/db008876c33241ce29db417a0bb7ac9e9b1bdfaa.png)

1. Leaving the `Source Path` field blank defaults to the current time, or “now”.
2. Use the `Start of Time` operation to set the `Day` unit to zero for the selected Timezone.

This results in a Date object being added to the payload that represents 00:00:00 for the current day, or “midnight”. You can follow this with another Date/Time Node to subtract one day if you want midnight to midnight for the previous day.

Then in the [Data: Gauge Query Node](https://docs.losant.com/workflows/data/gauge-query/), use that date as the `Range End` and set the duration to 24 hours (in milliseconds).

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/d1fa3bdaedcd60ac297658b6a35b2d0e844e39cf.png)

The `{{formatDate working.midnight 'x'}}` helper converts the date object to a Unix timestamp (milliseconds since epoch).

---

<div class="post-metadata">

**Author:** ![Jules\_Huguenin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/jules_huguenin/32/4031_2.png) [@Jules\_Huguenin](https://forums.losant.com/u/Jules_Huguenin)\
**Post date:** [November 24, 2020, 5:22am UTC](https://forums.losant.com/t/data-time-series-node/1068/13 "2020-11-24T05:22:10Z")

</div>

Thanks @Brandon_Cannaday,  
Sorry I haven’t given you enough details.  
I have 3 attributes, each attribute is a counter that counts during its own shift (morning, afternoon, overnight). I have used a similar method to yours to populate each attribute.  
Now, I want to put these three attributes on a graph and show the value for each day using a resolution of 24hrs.  
Problem is a 24hrs period starts at 1PM local time. My d-day morning shift shows up at d-1.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [November 24, 2020, 6:09pm UTC](https://forums.losant.com/t/data-time-series-node/1068/14 "2020-11-24T18:09:50Z")

</div>

I understand now. The Time Series resolution still buckets on GMT, so no changes there. I suppose in your case you _could_ query each day individually using the method above using a Loop Node. You would not be able to use our built in dashboard tools to display it, but it could be displayed in a custom experience using a third-party charting library.
