Reporting on data


#1

What are my options if I want to do some reporting on data that lives in either a data table or time series data?
I need to do some totals and subtotals for day , month and year.


#2

There are a number of different ways to go about this for time series data. You could use any of the following:

  • The Data Explorer, where you can set your time range and look at the aggregates tab (or set resolution and aggregations and look at the “All Data” tab).
  • The Gauge Query node, where you can set your start time, duration, and aggregation and get a single value out.
  • The Time Series node, which would allow you to doing things like daily totals for multiple days at once.
  • The Device State Table dashboard block, where you could set up a resolution and aggregation and get a table of data similar to the data explorer.
  • The Data REST API, which would allow you to write custom code and query and extract the exact data you need to do your aggregations.
  • For absolute control, you could export the data for a device as a CSV, and operate on it.

For doing any sort of aggregation on data tables, you will end up needing to do a lot more manual work, because Losant generally doesn’t expect “aggregate-able” data to be stored there. You could potentially do something with the Custom Chart dashboard block, or a complicated workflow that uses the Get Rows workflow node where you then aggregate the values yourself in the workflow. You could also always export the data table and operate on the CSV locally with a tool like Excel.