Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

So here's the scenario: I've got a DVWP that contains one column that I would like to sum. I'm using a standard layout so that users can use the "Sort" and "Group By" toolbar. When the user chooses a column to "Group By", I would like to display a sum for each group.

I found that by changing the calls to dvt_1.groupfooter to include the showfooter parameter, I can display the group footer. However, when I try to sum on $nodeset/@MyColumn, I get a total sum for all items, not just the items in the group. When I try to sum on @MyColumn, I get the value of the next value in the set (e.g. the first value in the next group).

What is the correct path to sum, or how can I set this up?

share|improve this question

1 Answer 1

You'll need to filter the nodeset based on the current value for the grouping. It'll look something like this:

sum($nodeset[@ColumnName = $thisValue]/@MyColumn)

The filter in the brackets is what you'll need to figure out. The dvt_1.groupfooter is probably getting the column value as a parameter.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.