Skip to main content
6-Contributor
November 30, 2022
Solved

Operations on datatable / arithmetic average / weighted average

  • November 30, 2022
  • 1 reply
  • 912 views

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?

 

Best answer by PaiChung

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.

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
December 1, 2022

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.