Curious George Posted August 6, 2018 Share Posted August 6, 2018 I have a condition that represent unit procedures. These capsules come from a batch execution system connector. Each capsule in the condition contains a property called 'Max Temperature'. I am trying to create a condition that just have the hot capsules. I am using a Seeq formula and filter to do this. Here's my formula: $c.filter( $cap -> $cap.getProperty('Max Temperature').isGreaterThan(170) ) I don't get any errors from this formula, but, I don't get any results. I know some of the max temperatures are higher than 170 because I can view that in the Seeq Details pane: What am I doing wrong? Link to comment Share on other sites More sharing options...
Guest Jon Peterson Posted August 6, 2018 Share Posted August 6, 2018 This is a common issue when using capsule properties. In Seeq properties are always stored as strings. So, before you can filter based on limits you need to convert the property to a number. This should fix the issue: $c.filter( $cap -> $cap.getProperty('Max Temperature').toNumber().isGreaterThan(170) ) You may want to go one step further and set the UOM. Assuming this is degrees $c.filter( $cap -> $cap.getProperty('Max Temperature').toNumber().setUnits('C').isGreaterThan(170C) ) Make sure you put the proper units on the value in the isGreaterThan function. Link to comment Share on other sites More sharing options...
Steve Sliwa Posted August 6, 2018 Share Posted August 6, 2018 Another cool thing you do with Seeq is create a signal from the capsule properties. Here's an example: $a.transformToSamples( $cap -> Sample( $cap.getMiddle(), $cap.getProperty('Max Temperature').toNumber().setUnits('C') ), 6h ).toStep() Note the toStep() is often used when plotting values that apply to a capsule (max temperature in this case. Link to comment Share on other sites More sharing options...
Curious George Posted October 29, 2018 Author Share Posted October 29, 2018 Thanks. This helps. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.