I have an output from my SQL database saved as an InfoTable in ThingWorx (I've already filtered the timestamp before extracting it). How can I average all of the data in my InfoTable? I couldn't find a way to extract the data into an array (if that's even possible).
Solved! Go to Solution.
You could try something like this:
var params = { t: myInfoTable, columns: "Quantity, Age", aggregates: "AVERAGE"};
var result = Resources["InfoTableFunctions"].Aggregate(params);
You might also want to check https://community.ptc.com/t5/IoT-Connectivity-Tips/Getting-to-Know-InfoTables-pdf/ta-p/818843
You could try something like this:
var params = { t: myInfoTable, columns: "Quantity, Age", aggregates: "AVERAGE"};
var result = Resources["InfoTableFunctions"].Aggregate(params);
You might also want to check https://community.ptc.com/t5/IoT-Connectivity-Tips/Getting-to-Know-InfoTables-pdf/ta-p/818843
Hi @AF_10333884 ,
It appears that there is a reply that answers your question. For the benefit of other Community Members who may have the same question, it would be great if you could designate it as the Accepted Solution.
In the event that this response did not answer your question, please post your current status so that we can continue to support.
Thanks for using the PTC Community!
Regards,
Charles
Just a thought: Could you let the database produce an average for you?
dgg