Hi everyone, just wondering if it’s possible to get a widget to give me the sum of data within the preset time intervals, and refresh once the new time interval is selected? I’m trying to do it for a rain gauge, where I might like to see the data over the last 3 weeks, then a month…etc…
Hi Andrew,
To accomplish that you will need the help from an analysis.
1. Create a widget to display the data. (You can set the variable rain_sum_result). *See Screenshot
2. Create a form to input the preset interval (3 weeks?) and submit. *See Screenshot
3. Create an analysis that will receive the form content and process the data. **
4. Setup to run the analysis when submitting the form.
** Basically you will perform a GET request on your device to get the SUM of a certain period of time, see the TagoIO SDK which will guide you through (Device GET data) → https://js.sdk.tago.io/classes/device.html#getdata
Once you have the result, you will need to perform a sendData to that device sending the rain_sum_result variable.
-Guilherme
Is it possible to get the start date and end date from the dashboard preset interval instead of creating a form and selecting it again?
Hello zsu[@user:10099735552]zsu,
The dashboard’s preset interval isn’t exposed to analyses, so you can’t pull its start and end dates programmatically right now. I’ve flagged this gap to our product team for possible inclusion on the roadmap.
In the meantime, you may want to use a widget that offers the built-in Data Analytics “Sum” aggregation; this eliminates the need for custom code when you only need a total over the selected range.
Hello zsu[@user:10036361621]zsu! Together with a line chart, I would like to create a table with basic statistics about the data being shown on the line graph. The line graph itself uses the dashboard preset. It would be nice to be able to use data analytics on tables as well, like this:
Hi Fhmrocha!
We’ve already taken note of your suggestion for potential future improvements.
Thank you for your feedback! Much appreciated!

