Skip to main content
1-Visitor
February 20, 2020
Solved

Aggregation operations on Thing historical data

  • February 20, 2020
  • 4 replies
  • 2324 views

Hi,

 

I have just started exploring the ThingWorx and tried to fetch the historical data (time series) using get QueryPropertyHistory service. We can fetch using filters like date, record count, sorted etc.

I want to write a custom service that does aggregation operations on this data and persist this aggregated data in some form. 

What are the supported ways for handling such huge data, transform it and persist?

 

Thank you

Best answer by raluca_edu

Hi,

 

There is Aggregate function at the level of infotable. Please see this article: https://www.ptc.com/en/support/article/CS245756

 

So, actually you need to get the data into an infotable and then use aggregate function.

 

Hope it helps,

Raluca Edu

4 replies

raluca_edu
17-Peridot
February 20, 2020

Hi,

 

Don't know how huge is the data, but you can use DataTables to keep data.

Also, if you are using time series data, an idea would be to keep/log the properties values in InfluxDB (only starting Thingworx. 8.4.x).

 

Hope it helps,

Raluca Edu

1-Visitor
February 21, 2020

Thank you for the reply @raluca_edu 
I understand that the data tables are used to store the static data that is not tied to a single Thing. My confusion is the next part. Assuming I have the data table ready with the data, I want to do aggregate operations like sum, count, average etc on particular column.

Are there any OOTB solutions/functions/services for such use cases?

 

It would help if such is supported - either as a local/ remote(e.g. using java sdk) service, where manual/programmatic iteration of data is not needed.

raluca_edu
17-Peridot
February 21, 2020

Hi,

 

There is Aggregate function at the level of infotable. Please see this article: https://www.ptc.com/en/support/article/CS245756

 

So, actually you need to get the data into an infotable and then use aggregate function.

 

Hope it helps,

Raluca Edu