Forum Discussion
Aggregation(sum) from time column
Hi,
I would like to get help to make calculated column by 3 hrs aggregation (sum of value column) from DateTime column or Start of Hour column for each datasetID. Here is my dataset:
Thank you!
3 Replies
- HotChilliCommunity Champion
Do you want a rolling 3 hrs (so for each row, add up all values in the last 3 hours) or do you want to define periods of 3 hours from the first row 1500-1800, 1800-2100 etc?
Perhaps you could reply with the desired output from the supplied dataset (also can you post the dataset as data and not a picture please?)
- AnonymousNot applicable
Hi HotChilli ,
Thank You! there is value for each 15 min. but i would like to have value as aggregated by 3 hours. the desired output as follows:
value
DateTime
Calculated column 1 (Date/Time)
calculated column2 (value)
0.004
04-03-2019 15:15:00
04/03/2019 15:00
aggregated value
0
04-03-2019 15:45:00
04/03/2019 18:00
aggregated value
0.002
04-03-2019 16:00:00
04/03/2019 21:00
aggregated value
0.001
04-03-2019 16:15:00
04/03/2019 00:00
0
04-03-2019 16:30:00
04/03/2019 03:00
0.001
04-03-2019 16:45:00
04/03/2019 06:00
0
04-03-2019 17:00:00
04/03/2019 09:00
0
04-03-2019 17:15:00
04/03/2019 12:00
0.001
04-03-2019 17:30:00
04/03/2019 00:00
0
04-03-2019 17:45:00
04/03/2019 03:00
0.001
04-03-2019 18:00:00
04/03/2019 06:00
0
04-03-2019 18:15:00
04/03/2019 09:00
0.001
04-03-2019 18:30:00
04/03/2019 12:00
0
04-03-2019 18:45:00
06/03/2019 15:00
0.001
04-03-2019 19:00:00
06/03/2019 18:00
0
04-03-2019 19:15:00
06/03/2019 21:00
0.001
04-03-2019 19:30:00
07/03/2019 00:00
0
04-03-2019 19:45:00
07/03/2019 03:00
0
04-03-2019 20:00:00
07/03/2019 06:00
0
04-03-2019 20:15:00
Thank you!
- daxCommunity Support
Hi Anonymous ,
Did you want to get rolling value of 3 hours? If so , you could refer to my sample for details. (It seems that each hour's duration of timestamp is 3600 in your sample).
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.