<?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>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Calculated Field in a Secondary Data Connection</title><link>https://www.infopathdev.com:443/forums/thread/24499.aspx</link><pubDate>Fri, 16 Nov 2007 12:04:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24499</guid><dc:creator>adamrharding</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24499.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=24499</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I think if I understand you correctly then yes, you can.&lt;/p&gt;
&lt;p&gt;Put a field in the repeating table linked back to your main source.&amp;nbsp; Set its default value to your sum, but filter both elements by having a field for the row number of the row on&amp;nbsp;the&amp;nbsp;table.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;I hope this helps&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;</description></item><item><title>Calculated Field in a Secondary Data Connection</title><link>https://www.infopathdev.com:443/forums/thread/24391.aspx</link><pubDate>Tue, 13 Nov 2007 16:59:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24391</guid><dc:creator>blackhawk</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24391.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=24391</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there a way, without coding, to put a new field into a repeating table that is driven by a secondary data source, where this field performs a calculation on two other fields within each row of the repeating table?&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For example, I have one&amp;nbsp;column for 2006 and another column for 2007, and what I want to calculate is the variance between the columns.&lt;/p&gt;
&lt;p&gt;I can create a field in the main data source contained within a repeating group and place it in the table, but I only get the results of the first record.&amp;nbsp;&amp;nbsp; If this is the right methodology for doing this?&amp;nbsp;&amp;nbsp; If so, what I can&amp;#39;t figure out is:&amp;nbsp; Should I be filtering off the secondary data source or the main data source, and what context does Current() operate in; the repeating table or the main data source?&lt;/p&gt;
&lt;p&gt;Here is the actual calculation:&lt;/p&gt;
&lt;p&gt;xdXDocument:GetDOM(&amp;quot;History&amp;quot;)/dfs:myFields/dfs:dataFields/tns:StringResponse/tns:StringResult/default/QueryResults/DataRow/Col8 &lt;br /&gt;- xdXDocument:GetDOM(&amp;quot;History&amp;quot;)/dfs:myFields/dfs:dataFields/tns:StringResponse/tns:StringResult/default/QueryResults/DataRow/Col7&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the help.&lt;/p&gt;</description></item></channel></rss>