cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Beginner question: how to query some data and apply a little math?

binaryPUNCH
4-Participant

Beginner question: how to query some data and apply a little math?

Hi. Still learning ThingWorx so bear with me. I managed to log some live property data with a ValueStream using an Influx persistence provider. And showing it on a LED/Guage in a mashup. So far so good, cool stuff.

 

But what now, if I would like to apply some math to the property values to e.g. calculate output over the last 5 minutes. Can I write custom queries to InfluxDb, or must everything go through the ValueStream for mashups?

 

What's the recommended approach?

1 REPLY 1

Hello,

 

Here's a month-old article, which suggests that you can't do native InfluxDB aggregations just yet. It also offers some workarounds, e.g. using InfluxDB's REST endpoints.

 

On a side note, one of the methods we used successfully in the past (before InfluxDB) is pre-aggregating data at the time of ingestion, i.e. store running totals / averages / etc. Depending on your use case it might have dramatic effect on performance at the expense of overall database size and additional code complexity.

 

Regards,

Constantine

Top Tags