I have a view with a number of columns. For simplicity, lets say there are the following columns:
SiteID, FeatureID, HighestScore, AverageScore
So there is a site, with a number of features. Each feature has a score. The view shows these scores, and then calculates the highest score and the average score.
What I need to do is order the data according to the HighestScore, and then the AverageScore. However, the problem is that each site can appear more than once in this data. I need to keep the Sites together.
For example, I can easily get the following:
SiteID | FeatureID | HighestScore | AverageScore |
1 | A1 | 4 | 4 |
2 | B1 | 4 | 4 |
1 | A2 | 3 | 3 |
3 | C1 | 3 | 3 |
But I actually need SiteID 1 to stay together, ie:
SiteID | FeatureID | HighestScore | AverageScore |
1 | A1 | 4 | 4 |
1 | A2 | 3 | 3 |
2 | B1 | 4 | 4 |
3 | C1 | 3 | 3 |
The data could easily be thousands or rows.