I have a requirement which is a little different than most summaries for grouped rows. When you use Count, you want what DevExpress gives out of the box: the number of actual records (nor grid rows) inside the group.
I need to count the number of DISTINCT records considering the grouped column whithin the group. I believe I could achive it by counting number of of grouped grid rows, not actual records within a group. Le me explain:
I've got the following columns: Name, City, DateVisited
I'm grouping by City, then Name… I would like to count how many distinct persons visited a city, not the count of how many visits in total there were.
Example:
Felipe, New York, 1/1/2010
Felipe, New York, 1/1/2011
Felipe, Rio, 1/1/2013
Julio, Rio, 1/1/2014
Felipe, Rio, 1/1/2014
If I group by city I would have:
- New York (count = 2)
-- Felipe, New York, 1/1/2010
-- Felipe, New York, 1/1/2011 - Rio (count = 3)
-- Felipe, Rio, 1/1/2013
-- Julio, Rio, 1/1/2014
-- Felipe, Rio, 1/1/2014
That's perfectly fine… but when I group by City, then Person, I got this:
- New York (count = 2)
-+ Felipe (count = 2) - Rio (count = 3)
-+ Felipe (count = 2)
-+ Julio (count = 1)
What I'm trying to do is this:
- New York (count = 1)
-+ Felipe (count = 2) - Rio (count = 2)
-+ Felipe (count = 2)
-+ Julio (count = 1)
In other words, the "city" group count is only counting the number of grouped rows immediately beneath it…
I don't know if that is the best approach… What I'm trying to do is to reuse the main grid of the application to allow the end-user to seamlessly get the most important data for them which is the count of individual persons that visited a city (actually it is the number of employees that went to a customer within a timeframe).
Is there a way to show the count of grouped rows in a group header?