girish.joshi Posted August 12, 2019 Share Posted August 12, 2019 Hi, How to get start and end values of a signal? The signal is created by loading data from a csv file. Also, how to get previous and next values from now(). Thanks, Link to comment Share on other sites More sharing options...
Thorsten Vogt Posted August 14, 2019 Share Posted August 14, 2019 Hi, you can get the start and end value the following way: 1. Import data from CSV and create a capsule for complete range of data by doing a simple Value Search: 2. In order to get only the first and the last value of the imported data create another two capsules that represent a small interval just after start and just before end of the capsule created in step 1. 3. Use the "Signal from Condition" tool to calculate the start and end values: You could also skip step 2 and use the capsule created in step 1 inside step 3 as the bounding condition. But then you have to specify a maximum duration of the capsule which may decrease performance. Regards, Thorsten Link to comment Share on other sites More sharing options...
Seeq Team Emily Johnston Posted August 14, 2019 Seeq Team Share Posted August 14, 2019 Hello, You can use the pick() function to find the value at or just before now. The below formula will pick the last sample value of a signal that exists within a capsule created from 1 day before now, to now. The result is a scalar showing the value at now. $signal.toScalars(capsule(now() - 1d, now())).pick(-1) To select the sample value just before now, change the pick() function in the formula. $signal.toScalars(capsule(now() - 1d, now())).pick(-2) The scalar value given as the result of this formula will continue to update as new data comes in and updates the current value. Regards, Emily Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.