<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Simple calculation is driving this newbie crazy</title><link>https://www.infopathdev.com:443/forums/thread/91770.aspx</link><pubDate>Tue, 30 Jul 2013 13:29:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91770</guid><dc:creator>Poppins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91770.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=91770</wfw:commentRss><description>&lt;p&gt;Look at this link: &lt;a href="http://www.braintrove.com/id/70"&gt;http://www.braintrove.com/id/70&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Simple calculation is driving this newbie crazy</title><link>https://www.infopathdev.com:443/forums/thread/59199.aspx</link><pubDate>Thu, 23 Sep 2010 08:15:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:59199</guid><dc:creator>Lars Nielsen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/59199.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=59199</wfw:commentRss><description>&lt;p&gt;I&amp;nbsp;needed to calculate an absolute value in a formula in InfoPath. I used a conditional expression.&amp;nbsp;&amp;nbsp;So for example say you have a field called MyNumber and you want to calculate its absolute value, you edit the formula (either as an expression box or as the default value of a text box).&amp;nbsp; Check the Edit XPath checkbox and enter the XPath expression:&lt;/p&gt;
&lt;p&gt;(1 - (my:MyNumber &amp;lt; 0) * 2) * my:MyNumber&lt;/p&gt;
&lt;p&gt;The expression (my:MyNumber &amp;lt; 0) is 0 if MyNumber is positive or zero, and 1 if MyNumber is negative.&lt;/p&gt;</description></item><item><title>Re: Simple calculation is driving this newbie crazy</title><link>https://www.infopathdev.com:443/forums/thread/24900.aspx</link><pubDate>Tue, 04 Dec 2007 17:28:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24900</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24900.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=24900</wfw:commentRss><description>&lt;p&gt;I would lke to know how you are gathering the input. My thought was you should not need the ABS function.&lt;/p&gt;
&lt;p&gt;If you had options buttons -5 -4 -3 -2 -1 0 +1 +2 +3 +4 +5 then it would be pretty straight forward and you would not need this validation, you could just use the values of the option buttons.&lt;/p&gt;
&lt;p&gt;I am assuming then they select positive or negative and then enter a value or just select a numeric option.&lt;/p&gt;
&lt;p&gt;You would put logic in a rule that said if selection equals negative 0 - numeric ( which would give you your negative value) otherwise the numeric.&lt;/p&gt;
&lt;p&gt;Let me know what the data values you have or attach your form and I can maybe help you better.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Simple calculation is driving this newbie crazy</title><link>https://www.infopathdev.com:443/forums/thread/24877.aspx</link><pubDate>Tue, 04 Dec 2007 00:50:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24877</guid><dc:creator>IShouldKnowBetter</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24877.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=24877</wfw:commentRss><description>&lt;p&gt;Clay,&lt;/p&gt;
&lt;p&gt;Thanks for the quick response.&amp;nbsp; When i create a rule and then set a field&amp;#39;s value, I can&amp;#39;t use an absolute value function.&amp;nbsp; There are only minimal math functions (avg, boolean, ceiling, etc.).&amp;nbsp; ABS is not one of them.&amp;nbsp; I tried to square the number and then take the square root, but it didn&amp;#39;t&amp;nbsp;have&amp;nbsp;the square root function and didn&amp;#39;t like the (x * x)^.5 format either.&amp;nbsp;&amp;nbsp;Without a ABS type function, I would need to verify&amp;nbsp;that each of&amp;nbsp;the data points&amp;nbsp;were correctly signed (+/-) by the person entering the data.&amp;nbsp; I&amp;#39;m sure I&amp;#39;m missing something obvious.&amp;nbsp; Thanks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Simple calculation is driving this newbie crazy</title><link>https://www.infopathdev.com:443/forums/thread/24876.aspx</link><pubDate>Tue, 04 Dec 2007 00:10:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24876</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24876.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=24876</wfw:commentRss><description>&lt;p&gt;Hey Bruce.&lt;/p&gt;
&lt;p&gt;I think you are making this more complicated then you need to. One of the great things about InfoPath forms is that you can do most things without code.&lt;/p&gt;
&lt;p&gt;Open up the control (double click) which the user makes the selection&amp;nbsp;from&amp;nbsp;and then create a rule. You should set a fields value as the action, select your target field, and then build your formula for calculating your value.&lt;/p&gt;
&lt;p&gt;You should be able to do everything you are looking for and it is a much simpler and controlled environment and it will validate your formula too.&lt;/p&gt;</description></item><item><title>Simple calculation is driving this newbie crazy</title><link>https://www.infopathdev.com:443/forums/thread/24875.aspx</link><pubDate>Mon, 03 Dec 2007 23:42:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24875</guid><dc:creator>IShouldKnowBetter</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24875.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=24875</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m so new at&amp;nbsp; this I&amp;#39;m not sure where to begin.&amp;nbsp; I&amp;#39;ve made a InfoPath 2003 form and connected it to a SharePoint 2003 forms list.&amp;nbsp; That all works great.&amp;nbsp; Now I&amp;#39;m trying to get a little fancier on data integrity.&amp;nbsp; My application is tracking activities related to energy consumption.&amp;nbsp; I&amp;#39;ve added a Options Button to indicate whether the item increases or decreases energy consumption.&amp;nbsp; After the button is selected, i want to convert the numbers entered for consumption and cost such that decreases are negative numbers and increases are positive numbers.&amp;nbsp; I was thinking a simple equation like multiplying the absolute value of the entered consumption amount by -1 if the decrease option button was selected, or +1 if the increase option was selected.&amp;nbsp; I thought the best place to do this is add an OnAfterChange Event to the Validation and Event Handlers for the Option Button&amp;#39;s properties.&amp;nbsp; The Microsoft Script Editor - script.js opens and I&amp;#39;M LOST!&amp;nbsp; How do&amp;nbsp;I reference the data field name? Assign a new value to it?&amp;nbsp;And, reference the math function abs()?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks for helping a beginner.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;--- Bruce&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>