category_name can't be found because it's not there. It's looking for it to be a sibling to category the way you wrote your XPath. You need to give it a more explicit pointer to the location of that field.
As for the list you want... you will need to have a repeating section bound to purchase, but filtered to only show a unique list of categories. Then it would should the category name, and do the sum like you are trying to figure out.

Signature
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
On Jul 6, 6:34 pm, "Greg Collins [InfoPath MVP]"
<gcollins_AT_msn_DOT_com> wrote:
> category_name can't be found because it's not there. It's looking for it to be a sibling to category the way you wrote your XPath. You need to give it a more explicit pointer to the location of that field.
That's the problem I'm having, how do I explicitly reference the
initial category_name? The context for the XPath expression starts
with the category_name node, I then back up the tree and descend into
the purchase node. How do I refer to the original node?
> As for the list you want... you will need to have a repeating section bound to purchase, but filtered to only show a unique list of categories. Then it would should the category name, and do the sum like you are trying to figure out.
How do I specify a unique filter? The only filter options I seem to
have available are XPath expressions, and I have no idea how to
express uniqueness with XPath.