<?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: XPath for summing qty for unique rows in repeating</title><link>https://www.infopathdev.com:443/forums/thread/8005.aspx</link><pubDate>Wed, 19 Oct 2005 15:46:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8005</guid><dc:creator>pmbarnes</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8005.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8005</wfw:commentRss><description>Thank you for the tip, Frank. That did it! I&amp;#39;m pretty new to XPath and it has my head spinning at times, but I got this to work with your suggestion. The final expression is:&lt;br /&gt;&lt;br /&gt;sum(/descendant-or-self::node()/my:Item[my:PartNum = current()/../my:PartNum]/my:ItemQty)&lt;br /&gt;&lt;br /&gt;So I substituted &amp;quot;current()/../my:PartNum&amp;quot; for the hardcoded PartNum value.</description></item><item><title>Re: XPath for summing qty for unique rows in repeating</title><link>https://www.infopathdev.com:443/forums/thread/8004.aspx</link><pubDate>Wed, 19 Oct 2005 06:17:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8004</guid><dc:creator>franck</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8004.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8004</wfw:commentRss><description>Hi, have you tried to play with current() ?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Franck Dauché</description></item><item><title>XPath for summing qty for unique rows in repeating</title><link>https://www.infopathdev.com:443/forums/thread/5017.aspx</link><pubDate>Wed, 19 Oct 2005 00:17:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:5017</guid><dc:creator>pmbarnes</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/5017.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=5017</wfw:commentRss><description>I have an inventory form that has multiple sections in which the same part # can be entered. (Think of each section like a grouping of parts, and parts can be duplicated between sections.) After all the data is entered I want to be able to display one repeating table that has one row for each unique part #. I want this row to have the total quantity for this part # across all sections. So if a user entered part # 125P-4 in three sections, with quantities of 2, 5, and 1, respectively, I want the summary inventory table to show only one row for part 125P-4 with a total qty of 8.&lt;br /&gt;&lt;br /&gt;Each part is represented by a repeating group called Item, which has, among other child elements, a PartNum element.&lt;br /&gt;&lt;br /&gt;I figured out the XPath expression to filter the repeating table bound to the Item group so that only unique part numbers appear:&lt;br /&gt;&lt;br /&gt;PartNum = not(my:PartNum = preceding::my:PartNum)&lt;br /&gt;&lt;br /&gt;I've been trying for hours to figure out the XPath to show the total qty for each PartNum. I added another child element called ItemTotalQty to the Item group element. For the default value I'm able to get as far as displaying the total quantity across all sections for a hardcoded PartNum, e.g. the following yields 8 using my above scenario:&lt;br /&gt;&lt;br /&gt;sum(/descendant-or-self::node()/my:Item[my:PartNum =&lt;br /&gt;"125P-4"]/my:ItemQty)&lt;br /&gt;&lt;br /&gt;But it shows "8" for each row in the repeating table. So what I need to do is swap out the hardcoded part # "125P-4" with the unique PartNum in each row of the filtered repeating table. In other words, I want to say: "gimme the sum of all the Item\ItemQty elements where the Item\PartNum element = each unique PartNum entered by the user into the form." Is this even possible? How would I do this?</description></item></channel></rss>