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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Operations on datatable / arithmetic average / weighted average

Michael_Dezet
6-Contributor

Operations on datatable / arithmetic average / weighted average

I have doubts how to solve a certain problem.

I have big table of numbers in DATATABLE.
- Each row may have a different date
- I need to sum the numbers in the rows
- Then take the arithmetic average of the numbers in the row
- Then I need to be able to select the date (range) to calculate the average of all days(rows) in the selected range.

I am wondering how I should go about this.
How to divide the whole task into services?

 

ACCEPTED SOLUTION

Accepted Solutions

First of all I would be careful to do full operations on all records in your datatable, if you have a lot of records, you might impact performance (500K plus records)

Based on what you wrote, I would probably first get the records based on date range, then you can use Infotable functions to get SUM and Average I believe the infotable function is called Aggregate.

View solution in original post

1 REPLY 1

First of all I would be careful to do full operations on all records in your datatable, if you have a lot of records, you might impact performance (500K plus records)

Based on what you wrote, I would probably first get the records based on date range, then you can use Infotable functions to get SUM and Average I believe the infotable function is called Aggregate.

Announcements


Top Tags