<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/84422.aspx</link><pubDate>Wed, 14 Nov 2012 16:09:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84422</guid><dc:creator>luke20</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84422.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84422</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve just tried a few ways of doing this and found one that works without the NaN error..&amp;nbsp;I set up a couple of drop down lists all with n/a, 0, 1 &amp;amp; 2 - i put the following rule on the last drop down list that the user will select from:&lt;/p&gt;&lt;p&gt;condition: Rule runs when field changes&lt;/p&gt;&lt;p&gt;Rule type: action&lt;/p&gt;&lt;p&gt;set a fields value: (the text box that you want to have the answer in) to dropdownlist1 + dropdownlist2 + dropdownlist3&lt;/p&gt;&lt;p&gt;hope this helps&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/84366.aspx</link><pubDate>Tue, 13 Nov 2012 03:46:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84366</guid><dc:creator>spjeff</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84366.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84366</wfw:commentRss><description>&lt;p&gt;I had a similar issue with NaN headaches.  Essentially I wanted to show a warning message (section with red background color) when the percentage exceeds 100%.  The solution for me was a simple translate() function I found at 

&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="http://braintrove.com/id/71"&gt;http://braintrove.com/id/71&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;translate(../my:Dividend div ../my:Divisor, &amp;quot;aN&amp;quot;, &amp;quot;0&amp;quot;)&lt;/strong&gt;
&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;This effectively turns &amp;quot;NaN&amp;quot; into &amp;quot;0&amp;quot; so the conditional formatting rule can work correctly.&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/72006.aspx</link><pubDate>Mon, 14 Nov 2011 01:13:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:72006</guid><dc:creator>Joey_86</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/72006.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=72006</wfw:commentRss><description>&lt;p&gt;Thanks Jimmy, it worked like a charm, although for some reason now my web form is lagging a bit when a user makes a dropdown selection.&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71963.aspx</link><pubDate>Fri, 11 Nov 2011 12:09:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71963</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71963.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71963</wfw:commentRss><description>&lt;p&gt;This should work:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;(original formula)&lt;/strong&gt;&lt;/em&gt; * not((criticalField1 | criticalField2)[. = 0])&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71960.aspx</link><pubDate>Fri, 11 Nov 2011 06:34:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71960</guid><dc:creator>Joey_86</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71960.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71960</wfw:commentRss><description>&lt;p&gt;Jimmy/Scott, just a final quick question that I&amp;#39;ve come across, using this attached form as an example. For instance I will have 2 critical questions with a score of either &amp;#39;0&amp;#39; or &amp;#39;2&amp;#39;, would it be possible to use that formula in the total? So basically, the user would go through and select the values from the other dropdowns but if they select one or either of the criticals and set them to &amp;#39;0&amp;#39; then the total is an automatic &amp;#39;0&amp;#39; score, but if they don&amp;#39;t then the total keeps calculating to get the total score of the dropdown fields.&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Jimmy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;You should be able to accomplish this with:&lt;/p&gt;
&lt;p&gt;sum((field1 | field2 | field3)[. != &amp;#39;n/a&amp;#39;])&amp;nbsp;div (2 * count((field1 | field2 | field3)[. != &amp;#39;n/a&amp;#39;]))&lt;/p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71958.aspx</link><pubDate>Fri, 11 Nov 2011 02:22:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71958</guid><dc:creator>Scott Rooke</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71958.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71958</wfw:commentRss><description>You are welcome Joey.  And Jimmy, I ended up using a variation of what you sent today to solve a new need for a new form I was building today.  Very timely! &lt;br /&gt;&lt;br /&gt;Best!&lt;br /&gt;&lt;br /&gt;Scott</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71956.aspx</link><pubDate>Thu, 10 Nov 2011 23:44:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71956</guid><dc:creator>Joey_86</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71956.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71956</wfw:commentRss><description>&lt;p&gt;Thanks Jimmy, that formula works great, also thanks Scott for your help in this issue too.&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71928.aspx</link><pubDate>Thu, 10 Nov 2011 09:29:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71928</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71928.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71928</wfw:commentRss><description>&lt;p&gt;You should be able to accomplish this with:&lt;/p&gt;
&lt;p&gt;sum((field1 | field2 | field3)[. != &amp;#39;n/a&amp;#39;])&amp;nbsp;div (2 * count((field1 | field2 | field3)[. != &amp;#39;n/a&amp;#39;]))&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71926.aspx</link><pubDate>Thu, 10 Nov 2011 06:50:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71926</guid><dc:creator>Joey_86</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71926.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71926</wfw:commentRss><description>&lt;p&gt;The attached is basically what I&amp;#39;m trying to do, so basically even if a user selects a &amp;#39;n/a&amp;#39; it still keeps calculating, so for example, if you have 3 questions and the user selects a score of 2 for 2 of the questions and a n/a for the 3rd the score total still equals 100% this will be the same if all 3 questions are n/a, etc.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks so much for your help Scott&lt;/p&gt;
&lt;p&gt;Joey :)&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71925.aspx</link><pubDate>Thu, 10 Nov 2011 06:39:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71925</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71925.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71925</wfw:commentRss><description>&lt;p&gt;Can you show us the formula you&amp;#39;re using to do this calculation?&amp;nbsp; There may be a simpler way without using a bunch of hidden fields.&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71924.aspx</link><pubDate>Thu, 10 Nov 2011 06:17:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71924</guid><dc:creator>Scott Rooke</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71924.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71924</wfw:commentRss><description>Bummer.... &lt;br /&gt;&lt;br /&gt;Any chance you can attach the form to this post?  Save a copy and and delete all non related fields.  I&amp;#39;ll take a look at it.&lt;br /&gt;&lt;br /&gt;Let me know&lt;br /&gt;&lt;br /&gt;Scott</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71921.aspx</link><pubDate>Thu, 10 Nov 2011 05:32:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71921</guid><dc:creator>Joey_86</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71921.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71921</wfw:commentRss><description>&lt;p&gt;Speaking of getting a little tricky, its managed to get me confused in the process. So now there are 3 fields:&lt;/p&gt;
&lt;p&gt;1) The dropdown with options (n/a, 0, 1 &amp;amp; 2)&lt;/p&gt;
&lt;p&gt;2) The numberField &lt;/p&gt;
&lt;p&gt;3) hiddenField&lt;/p&gt;
&lt;p&gt;Rules:&lt;/p&gt;
&lt;p&gt;1) Dropdown &lt;strong&gt;not equal to&lt;/strong&gt; &amp;quot;n/a&amp;quot; (set field value: &lt;em&gt;numberField = number(.) + numberField&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;2) hiddenField &lt;strong&gt;is blank&lt;/strong&gt; (set field value: &lt;em&gt;hiddenField = Dropdown&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;3) hiddenField &lt;strong&gt;is not blank&lt;/strong&gt; (set field value: &lt;em&gt;hiddenField - numberField&lt;/em&gt;, set field value: &lt;em&gt;numberField = Dropdown&lt;/em&gt;, set field value: &lt;em&gt;hiddenField = Dropdown&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;I hope I&amp;#39;ve set the rules correctly to how you&amp;#39;ve explained it but it didn&amp;#39;t work, its also pulling across the &amp;#39;n/a&amp;#39; selection that we didn&amp;#39;t want in the calculation.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71920.aspx</link><pubDate>Thu, 10 Nov 2011 04:03:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71920</guid><dc:creator>Scott Rooke</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71920.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71920</wfw:commentRss><description>Ok.  Let&amp;#39;s see.... this is going to get a little tricky so I&amp;#39;ll to keep it simple. &lt;br /&gt;&lt;br /&gt;

You might need to create a second hidden field for each of the dropdowns to store the value when it is first set.  So your rules will get more complicated but this is how I would do it. &lt;br /&gt;&lt;br /&gt;
If the second field is blank then set that field = the dropdown value.&lt;br /&gt;
If it is not blank then subtract that value from the numberField, add the new dropdown value to the nubmerField, and then overwrite the existing second hidden field for the dropdown with the new value so that it it changes again you&amp;#39;ll be able to update the numberField accordingly.&lt;br /&gt;&lt;br /&gt;Of course you&amp;#39;ll need to add these rules to each of the dropdown fields.&lt;br /&gt;&lt;br /&gt;Glad the first solution got you this far, let&amp;#39;s see if this gets you your desired output.&lt;br /&gt;&lt;br /&gt;

Best!&lt;br /&gt;&lt;br /&gt;
Scott</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71919.aspx</link><pubDate>Thu, 10 Nov 2011 03:35:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71919</guid><dc:creator>Joey_86</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71919.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71919</wfw:commentRss><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;Thanks so much for your prompt reply and yes it did work to provide me what I needed although now it has another problem, the score in the new numberField won&amp;#39;t refresh, it simply keeps adding onto the previous calculation if the dropdowns are changed more than once. Also on the new numberField, I&amp;#39;ve set it as a Decimal data type to get my answer as a percentage but the &amp;#39;Refresh value when formula is recalculated&amp;#39; is grey&amp;#39;d out.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks in advance :)&lt;/p&gt;</description></item><item><title>Re: Text &amp; Number Calculation in DropDown getting NaN error</title><link>https://www.infopathdev.com:443/forums/thread/71887.aspx</link><pubDate>Wed, 09 Nov 2011 11:55:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71887</guid><dc:creator>Scott Rooke</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71887.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71887</wfw:commentRss><description>Have you considered creating a hidden field with a data type of Whole Number or Decimal.  Then set a rule on each dropdown that if NOT &amp;quot;N/A&amp;quot; set the value of a field.  Your new number field --&amp;gt; numberField = number(.) + numberField&lt;br /&gt;&lt;br /&gt;Essentially insert a function of number(field name) and add it to the existing numberField value?  The period in the example is a reference to the field itself.  So you would add this rule to each drop down.  Would that get you what you are looking for?&lt;br /&gt;&lt;br /&gt;Let me know.&lt;br /&gt;&lt;br /&gt;Scott</description></item></channel></rss>