Subject:Grouping and summing ... Author:Alan Searle Date:01 Sep 2006 04:25 AM
Hi everyone,
I have a XML file that I need to filter and group. Apparently XSL 2.0 offers some good grouping features but unfortunately (for reasons of compatibility) I think I need to stay with XSL 1.0.
I have found that by using a 'key' I can get my XSL to group the data in my XML file (see example below) but am not sure how to apply a variable to filter to this grouping. I have experimented with a hard-coded filter (e.g. for a particular month: mnth='200602') but find that I don't get back what I need. This may be because the method I am using seems to focus in on the first record ( [1] ) but I'm not sure.
Anyway, below is my example so I hope that someone can give me some pointers so that I can apply a filter to retrieve grouped data for a particular team over a particular period (i.e. a number of months).
Or if anyone has recommendations of better methods of grouping, then that would be a great help.
Many thanks,
Alan Searle
XML: here I need to filter by mnth and display grouped/summed data of each team (i.e. Total Sales) ...
XSL: note that I have tried to incorporate the filter into the for-each statement. Is this correct? To remove the filter delete ** mnth='200601' and **