Dayyan Posted December 11, 2023 Share Posted December 11, 2023 Hi everyone, I hope this message finds you well. I am currently working on a project in Seeq and I am having some difficulty in aggregating capsules in 6-month intervals. I have a dataset represented by the variable $imd, and my current code is as follows: $imd.aggregate(count(), months(), startKey()).toStep() I want to adjust this code to specifically count the capsules in 6-month intervals, taking into consideration the information provided by Seeq's months() function. I understand that months() creates capsules for each month, but I'm unsure of how to adapt it for 6-month intervals.I'm working on a project where I am creating capsules for instances when a seal pot is manually drained. To analyze fluctuations, I was initially using derivatives and then creating capsules. However, I am now exploring alternatives and seeking advice on whether there might be a more effective approach. Any guidance or code examples would be greatly appreciated. Thank you in advance for your assistance! Thanks. Dayyan Link to comment Share on other sites More sharing options...
Solution Thorsten Vogt Posted December 11, 2023 Solution Share Posted December 11, 2023 Hi Dayyan, instead of months() you can use the periods() function: periods(6mo, 6mo, '2023-01-01', 'CET') The code above creates a capsules with a duration of 6 months every 6 months using the CET timezone. The timestamp specifies the origin that the capsules should be aligned to. Regards, Thorsten 1 Link to comment Share on other sites More sharing options...
Seeq Team Selmane Posted December 11, 2023 Seeq Team Share Posted December 11, 2023 Hello Dayyan, Please consider using the Periods formula instead of months. The syntax for it could be something like: periods(6months,6months, '2017-01-01T00:00:00','CET') Change CET by the timezone you are in. To analyze the fluctuations, it would be good to share a graph and see what this looks like to give you an advice. I hope this helps, --Selmane 1 Link to comment Share on other sites More sharing options...
Dayyan Posted December 12, 2023 Author Share Posted December 12, 2023 Hi Selmane, Thank you so much for that. The red capsules at the top indicate instances of manual draining. I am aiming to calculate the frequency of draining events recorded by these capsules over a six-month period, displaying the count on a tree map. This information is crucial for monitoring the condition of the seal over time. I have successfully implemented the code you provided; however, I've observed that the data ceases after 01/01/2023. The red capsules in the image below represent manual draining instances which I am aiming to count. The blue graph is the seal pot oil level. The red dotted line is the counter I have implemented as per the code you have provided. Please see the images as below. Thanks, Dayyan Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now