Just a comment and no answer, what about looking at Julian Days? https://en.wikipedia.org/wiki/Julian_day
Assuming that the input features have been sorted by date already and N represents the number of days to calculate average (e.g. N = 7 in this case, N = 365 in another case).
- Counter: Add 0-based sequential number attribute (e.g. "_count") to the features.
- Cloner: Create N copies for every feature. Save the copy number in an attribute (e.g. "_copynum").
- ExpressionEvaluator: Calculate _group = _count - _copynum
- Aggregator: Aggregate the features grouping by "_group", save the number of features aggregated (e.g. "_num"), and calculate the average of your interest attribute(s) (e.g. "value").
- Tester: Filter out the features whose "_num" is NOT equal to N.
Assuming that the input features have been sorted by date already and N represents the number of days to calculate average (e.g. N = 7 in this case, N = 365 in another case).
- Counter: Add 0-based sequential number attribute (e.g. "_count") to the features.
- Cloner: Create N copies for every feature. Save the copy number in an attribute (e.g. "_copynum").
- ExpressionEvaluator: Calculate _group = _count - _copynum
- Aggregator: Aggregate the features grouping by "_group", save the number of features aggregated (e.g. "_num"), and calculate the average of your interest attribute(s) (e.g. "value").
- Tester: Filter out the features whose "_num" is NOT equal to N.
Thank you, it was very helpful.
Is there a way to combine different types of calcul in a same column?
Now that I have a 7-days moving average, it means that I don't have an individual average for the 7 first values.
I'm not sure if what I mean is clear... I've to calculate an average with an increasing N for the 7 first values, then a 7-days moving average from the 7th.
day 1 average (day 1)
day 2 average (day 1, day 2)
day 3 average (day 1, day 2, day 3)
day 4 average (day 1, day 2, day 3, day 4)
...
day 7 average (day 1, day 2, day 3, day 4, day 5, day 6, day 7)
day 8 average (day 2, day 3, day 4, day 5, day 6, day 7, day 8)
...
And then combine everything in one column grouped by date.
Is it possible?
Thank you, it was very helpful.
Is there a way to combine different types of calcul in a same column?
Now that I have a 7-days moving average, it means that I don't have an individual average for the 7 first values.
I'm not sure if what I mean is clear... I've to calculate an average with an increasing N for the 7 first values, then a 7-days moving average from the 7th.
day 1 average (day 1)
day 2 average (day 1, day 2)
day 3 average (day 1, day 2, day 3)
day 4 average (day 1, day 2, day 3, day 4)
...
day 7 average (day 1, day 2, day 3, day 4, day 5, day 6, day 7)
day 8 average (day 2, day 3, day 4, day 5, day 6, day 7, day 8)
...
And then combine everything in one column grouped by date.
Is it possible?
If you want to keep the first 7 values, just drop the 'Filter out the features whose "_num" is NOT equal to N' part
If you want to keep the first 7 values, just drop the 'Filter out the features whose "_num" is NOT equal to N' part
thank you... it's the right values, now I just have to find a way to order them and connect them to the right date (by default they are all attributed to the same date).
thank you... it's the right values, now I just have to find a way to order them and connect them to the right date (by default they are all attributed to the same date).
Sorting by group will give you the correct order at the end, and if you sort by group in descending order prior to the aggregator you should also retain the correct date
Sorting by group will give you the correct order at the end, and if you sort by group in descending order prior to the aggregator you should also retain the correct date
it kind of works... I have the values in the right order, but the dates are wrong
The solution is good, but not perfect. The average value will be attributed to the first instance of the group, whilst it would be more correct to attibute it to the center of the group. The solution is to use the statisticscalculator instead and also calculate the median of the date (julian day). Then use the summary output and replace your date by _julianday._median or whatever it is called. Otherwise you'll observe a shift of N-days/2 towards the past.