Jump to content

Sean T

Recommended Posts

  • Seeq Team

Use Case Background

In certain use cases, it can be advantageous to move data forward or back in time. You may move signals as part of a data cleansing step in a cause and effect analysis, prior to performing a regression, or simply as a more intuitive visualization.  Here are some specific examples where this might be useful:

  • Comparing a process variable to a process setpoint when the process variable lags the setpoint.
  • Aligning inputs and outputs in unit operations where there is a known lag or residence time:
    • In a plug flow reactor analysis, you may want to line up the outlet flow rate with the inlet flow rates after a known residence time.
    • In a conveyor belt analysis, you may want to compare a widget created with an input variable upstream.
  • Aligning lab data with process data.

Moving a signal in time is easily accomplished in Seeq using the Formula tool and the function .move()


Moving a signal forward in time

1. Search and select the relevant signal in the data tab and click to add it to the trend.

2. In the Tools tab, select the Formula tool.

3. Give the formula an appropriate name and enter the following formula. Make sure to match the variable name in the formula tool. Here, $cp represents the Compressor Power signal I want to move.  


4. Execute the formula. You will now have a new signal where the data is shifted forward in time.


Moving a signal back (earlier) in time

Follow steps 1-4 above, but in step 3, use a negative sign to indicate moving the signal earlier.



Moving a signal by the value of another signal

Example use case:  Oftentimes, lab data is associated with the time the lab technician completed the test and recorded the results instead of the time when the sample was obtained from the process, which could be hours or days earlier. In order to do a root cause analysis, it would be useful if the quality results lined up with when the sample was obtained. The data could be moved using a static value, like the examples above, but if there is relevant data that can be used to dynamically shift the time period based on when the sample was actually taken, that may be more accurate and useful.

In this case, $labData is the lab result with the original timestamp, and $lagTime is the difference in time from when the sample is taken and when the sample result is recorded. By inputting this into the .move() function we can dynamically move the quality data to line up with the actual process conditions using the formula below.

To do this, follow steps 1-4 above, but in step 3, use another signal as your first formula parameter and the second parameter representing the maximum you want to move any given sample.

$labData.move($lagTime, 5min)

In the above example, $labData will be moved by the value indicated in $lagTime, up to 5 minutes, the maximum any sample will be moved.  

Content Verified DEC2023


Edited by Katie Pintar
Updated with current functionality
Link to comment
Share on other sites

  • 3 years later...
  • Super Seeqer


There is not currently a direct equivalent function that would allow you to move a capsule using a variable amount. 

However, below is a formula that does the same thing in a couple of steps. It comes with a couple of caveats however

  1. If you have capsule properties on the first calculation they will not be transferred over to the delayed signal
  2. This formula will delay the start and end of the capsule the same amount as defined by the value of your delay signal at the capsule start. You could probably extend this to do more complex transformations if needed 
$step1 = $condition.aggregate(totalDuration("min"), $condition, startKey(), 0s) 

$step2 = $step1.move($timeShiftSignal,2h)

$step2.toCapsules($sample -> capsule($sample.key(),$sample.key()+$sample.value()),30d)


Let me know if this helps get you on the right track. Also I am curious to understand more about your use case so that we can help improve the built-in functions in the future. 


  • Like 1
Link to comment
Share on other sites

Hi Shamus,

Thanks for this, this does help with what I'm after. The use case is to align conditions upstream of a variable speed conveyor belt with events downstream. Ideally the signal to adjust by would be an integral of the conveyor speed speed (i.e. integral of conveyor belt speed until it reaches total travel distance, for example if it travelled constantly at 6m/s and conveyor distance was 6,000m the offset time would be 1,000 seconds).

The other tricky part is given the majority of the analysis is downstream of the variable speed conveyor (so uses the downstream point as the base reference of time). I'd ideally like to set the integral up to calculate 'backwards' from the downstream event (i.e. integrate values backwards from a downstream reference point until it reaches the conveyor distance of 6,000m). This would then determine the correct time offset for the capsule/window for the upstream events.



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