Jump to content

Ali
Go to solution Solved by Teddy,

Recommended Posts

Hello, 

I'm trying to build a trend of yearly rolling averages based on an existing trend. 

I know if use signal from condition and then I input the condition and the bounding condition (yearly), it doesn't give me the rolling average for the past year. I need to look at it in a way where if I look at trend and select today's date, it gives me the average for the past year. So basically a trend of yearly rolling averages. Please help, thanks

 

  • Like 1
Link to comment
Share on other sites

  • Administrators
  • Solution

Ali,

I will preface this with saying that calculating a yearly rolling average can be slow. It requires looking at a lot of data.

You can create the condition you are looking for with the formula tool. The following syntax will generate a condition with a capsule everyday extending 1 year. 

periods(1year,1day)

See screen shot below for formula details.
image.png

Lastly you can calculate the rolling average with the signal from condition tool.  See screen shot below for how to set up a yearly rolling average.

image.png


Hope this helps,

Teddy
 

 

Content Verified FEB2024

Edited by Amanda Chng
Adding Content Verified text at the end of the answer
  • Like 1
Link to comment
Share on other sites

Thorsten, 

I used your formula to calculate the rolling avgs of previous year. I got the following trend (Formula2). 

image.thumb.png.20880cb514257accbcfdc49fbd1a9a2c.png

The green trend showing an avg of 0.0044 based on the previous year ending 12/11/2019 at 6:16 pm. However , when I check the same point of the rolling average in Formula 2, it's showing a different number of 0.004. This is case sensitive numbers, no decimals make a difference. I don't know why the rolling average at the same ending point (12/11 6:16pm)  is not the exact same as the initial trend. I even downloaded data to excel to verify the numbers. Thanks

Link to comment
Share on other sites

Hi Ali,

I think the green trend is calculating the average from 12/11/2018 6:16 pm to 12/11/2019 6:16 pm. The formula I gave you is resetting at 01/01/2019 and therefore calculating the average from 01/01/2019 00:00 to 12/11/2019 6:16 pm which might cause the difference. To use the formula with the intended range you may change it to

$signal.runningAggregate(average(), condition(1y, capsule(now()-1y, now())))

That will create a condition with one capsule beginning 1 year ago and ending now which will be used for the calculation. The value at the end of the capsule then matches the average calculated by Seeq for the display range.

image.thumb.png.7686f30b2fd77afa54eabf9b5cd2c0f1.png

However, as the window for the calculation (now - 1y) is changing, the calculated values for a specific timestamp are uncertain and may change frequently. Therefore I think you should disable the cache for the calculated item. 

See discussion in following topic: 

 

Regards, 

Thorsten

  • Like 1
Link to comment
Share on other sites

Thorsten,

Thanks a lot, this worked as intended. I have another question please. If I want to input future data for the green curve and then need to extend the rolling averages curve to predict how the rolling average changes with time and input data. Is it possible to do that in Seeq?

My intention is to input weekly/monthly future predictions data points and then see how the rolling averages for previous year changes with the input data.

Thanks, 

Ali

Edited by Ali
Link to comment
Share on other sites

Thank you. What if I want to input the forecast numbers myself (assume wb avg temp =72 F for dec, 71F for Jan, 69 for Feb, etc) rather than using existing data and then calculate the rolling averages for the future. Is it possible?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...