Calculating the quarterly mean of weekly values

Hi everyone,

I am currently trying to calculate the average or mean of the calender weeks for each quarter of a specific year.

This would be an example of my data:

Year Values
2017/1 4
2017/2 6
2017/3 11
2017/4 2
2017/5 4
2017/6 5
2017/7 87
2017/8 55
2017/9 3
2017/10 3
2017/11 34
2017/12 12

Does anyone know how to possibly solve this issue? I was also wondering what to do if a year has more or less than 52 weeks ? How would you specifiy this?

Thank you very much for your support!

Best,
Dora

Hi Dora!

Welcome to KNIME Community Forum!

I suggest for these kind of logic calculations to have a local reference file that would suggest definition/logic. In your case it would be a file containing weeks (in format you written above yyyy/week) in one column and in other information to which quarter they belong to. Best is to do this manually as you should know your business logic best.

Following above logic I have created an example workflow and here is a print screen of it:

After you read both data into KNIME (files are in data folder within workspace) you pretty much join them and then using GroupBy node calculate mean :wink:

Take a look at attached workflow and if any questions feel free to ask.
2019_05_03_Week_Mean_in_Quarter.knwf (18.7 KB)

Br,
Ivan

2 Likes

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