Jump to content

Change training window for a reference profile to end at now()


Recommended Posts

Hello.

I have a quick question regarding reference profiles. I would like to make a version of a reference profile that automatically updates it's training window, preferably with the training window ending at now(). Just in this case I have a reference profile which studies each signals yearly behavior, so in practice the signal would only have to update every Jan 1st. Rregardless it would be best for longevity's sake that this is done automatically if I create very many other reference profiles in the future etc.


image.png.ddc6e824fa652f2c5130653c5bf1aba5.png

The only method I tried right now was to duplicate the reference profile to formula and then change the end of the window to now(), but this does not work due to the uncertain values at the end I think.


image.png.756aceb65b3d3d0f5f1cd3072789222f.png

Thanks in advance. Best regards,

Joel

Link to comment
Share on other sites

  • 2 weeks later...
  • Seeq Team

Hi Joel,

Here is an idea to try, not sure if it will help. 

1. Create a timestamp for "x days ago" using the following Formula, specify the x days ago as you desire:

// 2 days ago, formatted to midnight
// (modify the -05:00 for the time zone of interest)
// (modify the "2d" parameter as needed to avoid uncertain data)
(now()-2d).toString()
.replace('/(?<year>....)-(?<month>..)-(?<day>..)T(?<hour>..):(?<minute>..):(?<sec>..)(?<dec>.*)Z/' , 
'${year}-${month}-${day}T00:00-05:00')
// next line may be needed to replace ? at end of string
.replace('/\\?/','')

2. Use the Formula result from step 1 as a "variable" in your existing Reference Profile formula, and put the variable reference in place of "now()" in your Reference Profile formula. 

(Also, if you don't really need 5 minute gridded values over the course of each yearly capsule for the profile average calculation, I would consider moving to 1 hour, 24 hours, etc.). 

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...