<?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: Using WHERE or IF conditions</title><link>https://www.infopathdev.com:443/forums/thread/8179.aspx</link><pubDate>Tue, 15 Nov 2005 01:55:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8179</guid><dc:creator>franck</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8179.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8179</wfw:commentRss><description>Hi Jay,&lt;br /&gt;&lt;br /&gt;Yes, a Category for you is just a row in the repeating section.  Now, if each Category has a unique Id (let's say an attribute).  You can loop through repeating sections and add values to running totals based on Ids.  You can get creative here, based on your business requirements.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Franck Dauché</description></item><item><title>Re: Using WHERE or IF conditions</title><link>https://www.infopathdev.com:443/forums/thread/8178.aspx</link><pubDate>Tue, 15 Nov 2005 01:42:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8178</guid><dc:creator>jay.whittaker</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8178.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8178</wfw:commentRss><description>So would this code search through the results and calculate totals where the data in "My:field1" matches (between instances of repeating sections). Therefore allowing me to have a dynamic totalling of values even if a new category is added in "My:field1"?&lt;br /&gt;&lt;br /&gt;-- Jay Whittaker --</description></item><item><title>Re: Using WHERE or IF conditions</title><link>https://www.infopathdev.com:443/forums/thread/8177.aspx</link><pubDate>Mon, 14 Nov 2005 02:15:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8177</guid><dc:creator>franck</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8177.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8177</wfw:commentRss><description>Hi Jay,&lt;br /&gt;&lt;br /&gt;Looks like you would just need to loop through your repeating sections, so, you wouldn't have to change the code each time a row is added.  You can display the metrics on a separate View and use the MSE to write your code.  Go to Tools / Programming / MSE.&lt;br /&gt;&lt;br /&gt;There you can loop through a repeating section using:&lt;br /&gt;var nodeList = XDocument.DOM.selectNodes("//my:group1/my:group2");&lt;br /&gt;if (nodeList.length&amp;gt;0)&lt;br /&gt;{&lt;br /&gt;  for (var i=0;i&amp;lt;nodeList.length;i++)&lt;br /&gt;  {&lt;br /&gt;    var node = nodeList&lt;i&gt;.selectSingleNode("my:field1");&lt;br /&gt;    XDocument.UI.Alert(node.text);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Franck Dauché</description></item><item><title>Re: Using WHERE or IF conditions</title><link>https://www.infopathdev.com:443/forums/thread/8176.aspx</link><pubDate>Mon, 14 Nov 2005 01:56:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8176</guid><dc:creator>jay.whittaker</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8176.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8176</wfw:commentRss><description>I am not sure how to edit the code behind. Also I think that this would mean that I have to search for an idetifyer by name. However if I do this I will have to recode every time a new element is added / changed.&lt;br /&gt;&lt;br /&gt;-- Jay Whittaker --</description></item><item><title>Re: Using WHERE or IF conditions</title><link>https://www.infopathdev.com:443/forums/thread/8175.aspx</link><pubDate>Tue, 08 Nov 2005 07:17:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8175</guid><dc:creator>franck</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8175.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8175</wfw:commentRss><description>Hi Jay,&lt;br /&gt;&lt;br /&gt;Have you tried code behind?  If you loop through the nodes of your repeating section, you can write code to customize running totals and stats based on your logic.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Franck Dauché</description></item><item><title>Using WHERE or IF conditions</title><link>https://www.infopathdev.com:443/forums/thread/5081.aspx</link><pubDate>Tue, 08 Nov 2005 07:05:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:5081</guid><dc:creator>jay.whittaker</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/5081.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=5081</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I am trying to find out whether there is a way to do advanced calculations/transformations in Infopath using something like a WHERE or IF statement. I have a repeated section, I want to say:&lt;br /&gt;&lt;br /&gt;- Where field X in repeated section = a, add these values and display in a field&lt;br /&gt;- Where field X in repeated section = b, add these values and display in a seperate field&lt;br /&gt;&lt;br /&gt;I have a system where information is entered on a monthly basis. However I want to display it on a quarterly basis. I have one repeating section where each instance is differentiated by the data in the fields only (the fields are all the same). However when I combine the data, I only want to combine instances with the same identifyer. As it stands, I am only able to calculate totals across all instances of the field. Not only the instance that has the same identifyer. (I hope this makes sense). &lt;br /&gt;&lt;br /&gt;&lt;b&gt;A simplified example of my form:&lt;/b&gt;&lt;br /&gt;Report Month: January&lt;br /&gt;Report Quater: Q3&lt;br /&gt;---------------repeating section-------------&lt;br /&gt;Metric Title: Number of Visitors [Identifyer]&lt;br /&gt;Metric Value: 100&lt;br /&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;----------- second instance of repeating section--------------&lt;br /&gt;Metric Title: % Of satisfied visitors [Identifyer]&lt;br /&gt;Metric Value: 80&lt;br /&gt;-------------------------------------&lt;br /&gt;=====================================================&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Form 2&lt;/b&gt;&lt;br /&gt;Report Month: February&lt;br /&gt;Report Quater: Q3&lt;br /&gt;---------------repeating section-------------&lt;br /&gt;Metric Title: Number of Visitors [Identifyer]&lt;br /&gt;Metric Value: 230&lt;br /&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;----------- second instance of repeating section--------------&lt;br /&gt;Metric Title: % Of satisfied visitors [Identifyer]&lt;br /&gt;Metric Value: 86&lt;br /&gt;-------------------------------------&lt;br /&gt;=====================================================&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Results&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Report Quater: Q3&lt;br /&gt;---------------repeating section-------------&lt;br /&gt;Metric Title: Number of Visitors [Identifyer]&lt;br /&gt;Metric Value: 100&lt;br /&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;----------- second instance of repeating section--------------&lt;br /&gt;Metric Title: % Of satisfied visitors [Identifyer]&lt;br /&gt;Metric Value: 80&lt;br /&gt;-------------------------------------&lt;br /&gt;---------------third instance of repeating section-------------&lt;br /&gt;Metric Title: Number of Visitors [Identifyer]&lt;br /&gt;Metric Value: 230&lt;br /&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;----------- fourth instance of repeating section--------------&lt;br /&gt;Metric Title: % Of satisfied visitors [Identifyer]&lt;br /&gt;Metric Value: 86&lt;br /&gt;-------------------------------------&lt;br /&gt;=====================================================&lt;br /&gt;&lt;br /&gt;When I total this I get the total of all "Metric Values" not just the ones with a similar title. I want to achieve a consolodated report while preserving the ability to change the metric titles (types) in the future.&lt;br /&gt;&lt;br /&gt;I hope all this makes sense. I would really appreciate any help.&lt;br /&gt;&lt;br /&gt;-- Jay Whittaker --</description></item></channel></rss>