How to Calculate a given average of a column based on another column and replace the values

Hi, I have a table with the following columns:

Date, X

Dates include year,month, day and hours.
X includes a certain speed
Example:
Date | X
2019-08-29 08:00:00| 38.6|
2019-08-29 14:00:00| 42.6|
2019-10-25 07:00:00| 46.6|
2019-09-02 05:00:00|40.0|
2019-08-29 07:00:00| 43.6|
2019-05-22 10:00:00| 42.6|
2019-11-25 07:00:00| 37.6|
2019-03-02 08:00:00|45.0|

I would like to sum the values ​​of x where the data are equal (such as repeated data on media 20 times in the real table) calculate a media and replace each row of the values ​​that were used to make a media.

Below is an example of what I would like it to look like, where I added the average of X where the date is equal to 8/29/2019, which appeared 3 times, and replaces the old values ​​with the average

          Date               |    X      

##2019-08-29 08:00:00| 41.6|##
##2019-08-29 14:00:00| 41.6| ##
2019-10-25 07:00:00| 46.6|
2019-09-02 05:00:00|40.0|
##2019-08-29 07:00:00| 41.6|##
2019-05-22 10:00:00| 42.6|
2019-11-25 07:00:00| 37.6|
2019-03-02 08:00:00|45.0|

Is it possible in KNIME do that ?

Thank you, and look forward to your reply.

Hi @IllusiveMan and welcome to the KNIME forum

I was thinking of a workflow like this replaced_by_mean.knwf (22.4 KB)
Screenshot%20from%202019-11-15%2021-02-34
gr. Hans

3 Likes

That’s exactly what I wanted to do, this will definitely solve my problem, thanks Hans!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.