Seeq Team Emily Johnston Posted March 17, 2020 Seeq Team Share Posted March 17, 2020 A customer asked if there was a way to create a scorecard that outputs the 3 most recent samples within a signal. This can be done in Seeq by executing the following steps: 1) Transform the desired signal to discrete samples in order to remove any interpolation. $signal.toDiscrete() 2) Create a condition with tiny capsules for each of the samples in the signal. $signal.toCapsules() 3) Create a condition for the Last 3 Capsules using formula. First, define the search window that is looking back from "now" for long enough to capture the last three samples. Then use this search window when selecting the desired tiny capsules that represent the most recent three samples. //Create a capsule from 1 day before now, to now. The last three capsules should occur within this window. $searchWindow = capsule(now()-1day, now()) //Create a condition consisting of the last 3 capsules of the Condition condition(1d, toGroup($searchWindow).last(), toGroup($searchWindow).pick(-2), toGroup($searchWindow).pick(-3)))) 4) Create a scorecard for the discrete values of the last 3 capsules condition. 5) Move the scorecard to an Organizer Topic and configure a custom date range that will auto-update. This way the scorecard will continue to update at the topic level. 2 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