Skip to main content
Feb 20, 2020 6:39 AM UTC
Solved

Aggregation operations on Thing historical data

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

Feb 21, 2020 1:13 PM UTC

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

Feb 20, 2020 1:03 PM UTC

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

Feb 21, 2020 7:06 AM UTC

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.

Feb 21, 2020 1:13 PM UTC

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