Take the 2-minute tour ×

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
add comment

1 Answer

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
add comment

Your Answer


