<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Evaluating 3 Fields - Inconsistent Results with Rules</title><link>https://www.infopathdev.com:443/forums/thread/101848.aspx</link><pubDate>Tue, 24 Mar 2015 20:01:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:101848</guid><dc:creator>ScottDeH</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/101848.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=101848</wfw:commentRss><description>&lt;p&gt;Greetings!&lt;/p&gt;&lt;p&gt;I&amp;#39;m using InfoPath 2013 on a Windows 7 64-bit OS&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;m getting inconsistent results from a set of conditions that I&amp;#39;m using on a form to evaluate the relationship between three values.&lt;/p&gt;&lt;p&gt;I&amp;#39;m developing a form that will be used in the field for collecting water samples.&amp;nbsp; The samplers will collect a series of three samples, entering each value into three fields on the form.&amp;nbsp; When the third field is filled I need the form to compare Field3 with Field1, and Field3 with Field2,&amp;nbsp;and set the value &amp;quot;Stabilized&amp;quot; in a status field &amp;quot;txtStatus&amp;quot; if the comparisons are all within .1 of each other.&amp;nbsp; If they are not within .1 then a second rule sets &amp;quot;txtStatus&amp;quot; to&amp;nbsp;&amp;quot;Not Stabilized&amp;quot;.&amp;nbsp; The evaluation needs to take into account the fact that the each value might be greater than or less than the previous value, but it&amp;#39;s the absolute difference that I need to assess.&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have&amp;nbsp;a rule &amp;quot;Is Stable&amp;quot; which includes the following condition bound to Field3.&amp;nbsp; If this conditions evaluates to true it sets the value for txtStatus to &amp;quot;Stabilized&amp;quot;:&lt;/p&gt;&lt;p&gt;(../my:Field1 - .) * (1 - 2 * (../my:Field1 - . &amp;lt; 0)) &amp;lt;= 0.1 &lt;/p&gt;&lt;p&gt;and&lt;/p&gt;&lt;p&gt;(../my:Field2 - .) * (1 - 2 * (../my:Field2 - . &amp;lt; 0)) &amp;lt;= 0.1&lt;/p&gt;&lt;p&gt;The complimentary rule &amp;quot;Not Stable, also set on Field3, includes the following condition.  If this conditions evaluates to true it sets the value for txtStatus to &amp;quot;Not Stabilized&amp;quot;:&lt;/p&gt;&lt;p&gt;(../my:Field1 - .) * (1 - 2 * (../my:Field1 - . &amp;lt; 0))&amp;nbsp;&amp;gt; 0.1 &lt;/p&gt;&lt;p&gt;or&lt;/p&gt;&lt;p&gt;(../my:Field2 - .) * (1 - 2 * (../my:Field2 - . &amp;lt; 0))&amp;nbsp;&amp;gt; 0.1&lt;/p&gt;&lt;p&gt;&amp;nbsp;The &amp;quot;(1 - 2 * (../my:Field1 - . &amp;lt; 0))&amp;quot; part is my understanding (from &lt;a href="http://www.infopathdev.com/forums/p/22269/77077.aspx"&gt;http://www.infopathdev.com/forums/p/22269/77077.aspx&lt;/a&gt;)&amp;nbsp;how to calculate absolute value in InfoPath.&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;In practice, the results from these rules are inconsistent... sometimes&amp;nbsp;they work and sometimes&amp;nbsp;they don&amp;#39;t.&amp;nbsp; Here&amp;#39;s an example of&amp;nbsp;(these are pH readings, BTW...):&lt;/p&gt;&lt;p&gt;Field1: 7.0, Field2: 7.1, Field3: 7.0, results in &amp;quot;Stabilized&amp;quot; (correct)&lt;/p&gt;&lt;p&gt;Field1: 7.1, Field2: 7.2, Field3: 7.1, results in &amp;quot;Not Stabilized&amp;quot; (wrong - should be &amp;quot;Stabilized&amp;quot;)&lt;/p&gt;&lt;p&gt;Field1: 7.2, Field2: 7.3, Field3: 7.2, results in &amp;quot;Stabilized&amp;quot; (correct)&lt;/p&gt;&lt;p&gt;Any idea where my problem is with the way the conditions are written?&amp;nbsp; Any thoughts on a better way to go about this process?&lt;/p&gt;&lt;p&gt;Many thanks for any input.&lt;/p&gt;</description></item></channel></rss>