<?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>Setting rules in a dropdown for calculations</title><link>https://www.infopathdev.com:443/forums/thread/65053.aspx</link><pubDate>Thu, 10 Mar 2011 10:12:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65053</guid><dc:creator>Dogtown</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65053.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65053</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve got 2 dropdowns, &lt;br /&gt;in the first one&amp;quot;Budget Item&amp;quot;&amp;nbsp;I&amp;#39;ve got 3 choices (&amp;quot;Coffe &amp;amp; Refreshments&amp;quot;, &amp;quot;Vin d&amp;#39;Honeur&amp;quot; and&amp;nbsp;&amp;quot;Meal&amp;quot;) &lt;br /&gt;in the second one &amp;quot;Currency&amp;quot;&amp;nbsp;2 choices (&amp;quot;EUR&amp;quot;, &amp;quot;UHF&amp;quot;)&amp;nbsp;. &lt;br /&gt;&lt;br /&gt;I&amp;#39;m looking to have a user select one of the 3 choices of the &amp;quot;Budget&amp;quot; Item&amp;quot; and 1 of the &amp;quot;Currencies&amp;quot; that would then do a simple calculation and output the result into the text&amp;nbsp;box &amp;quot;Calculation&amp;quot;.&lt;/p&gt;
&lt;p&gt;In the first dropdown, I&amp;#39;ve set&amp;nbsp;a rule with a condition in a field&amp;#39;s value for each choices;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;a). &amp;quot;Calculation&amp;quot; = (&amp;quot;Guests&amp;quot; + &amp;quot;Personnel&amp;quot;) * 2 ---&amp;gt;&amp;nbsp;if &amp;quot;Budget Item&amp;quot; contains &amp;quot;Coffe &amp;amp; Refreshments&amp;quot; and &amp;quot;Currency&amp;quot; contains &amp;quot;EUR&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;b). &amp;quot;Calculation&amp;quot; = (&amp;quot;Guests&amp;quot; + &amp;quot;Personnel&amp;quot;) *&amp;nbsp;500&amp;nbsp; ---&amp;gt; if &amp;quot;Budget Item&amp;quot; contains &amp;quot;Coffe &amp;amp; Refreshments&amp;quot; and &amp;quot;Currency&amp;quot; contains &amp;quot;HUF&amp;quot;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;a). &amp;quot;Calculation&amp;quot; = (&amp;quot;Guests&amp;quot; + &amp;quot;Personnel&amp;quot;) * 5&amp;nbsp;&amp;nbsp; ---&amp;gt; if &amp;quot;Budget Item&amp;quot; contains &amp;quot;Vin d&amp;#39;Honneur&amp;quot; and &amp;quot;Currency&amp;quot; contains &amp;quot;EUR&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;or&lt;br /&gt;b). &amp;quot;Calculation&amp;quot; = (&amp;quot;Guests&amp;quot; + &amp;quot;Personnel&amp;quot;) * 1000 ---&amp;gt; if &amp;quot;Budget Item&amp;quot; contains &amp;quot;Vin d&amp;#39;Honneur&amp;quot; and &amp;quot;Currency&amp;quot; contains &amp;quot;HUF&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;a). &amp;quot;Calculation&amp;quot; = (&amp;quot;Guests&amp;quot; + &amp;quot;Personnel&amp;quot;) *&amp;nbsp;30&amp;nbsp;&amp;nbsp; ---&amp;gt; if &amp;quot;Budget Item&amp;quot; contains &amp;quot;Meal&amp;quot; and &amp;quot;Currency&amp;quot; contains &amp;quot;EUR&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or&lt;br /&gt;
&lt;div&gt;b). &amp;quot;Calculation&amp;quot; = (&amp;quot;Guests&amp;quot; + &amp;quot;Personnel&amp;quot;) *&amp;nbsp;5000&amp;nbsp;---&amp;gt; if &amp;quot;Budget Item&amp;quot; contains &amp;quot;Meal&amp;quot; and &amp;quot;Currency&amp;quot; contains &amp;quot;HUF&amp;quot;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;
&lt;div&gt;
&lt;div&gt;&amp;quot;Guests&amp;quot; and &amp;quot; Personnel&amp;quot;&amp;nbsp;are text boxes where the user inputs the number of participants. &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;There is trouble shooting to display the corect result&amp;nbsp;in the &amp;quot;Calculation&amp;quot; box: &lt;/div&gt;
&lt;div&gt;For 1. a). it works, example if &amp;quot;Guest&amp;quot; and &amp;quot;Personel&amp;quot; values are 2 respectivly then the result in &amp;quot;Calculation&amp;quot; is 8.&lt;/div&gt;
&lt;div&gt;For all others the result is always the same as for 1. a).&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Does anyone have a clue or is there maybe an&amp;nbsp;easyer way of doing the calculation?&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Thank you for your support.&lt;br /&gt;Robert&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;
&lt;div&gt;
&lt;div&gt;&lt;br /&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;</description></item></channel></rss>