hierarchical-grouping

Nested grouping strategy/algorithm c#

Not sure if I have to correct label for this type of problem, but do you have any thoughts on a generic solution for the following? Given a collection of Invoices: var invoices = new List<Invoice>() { new Invoice() { Id = 1, Customer = "a", Date = DateTime.Parse("1/1/2009") }, new Invoice() { Id = 2, Customer = "a", Date = DateTime.Par...

How do I write a LINQ query that inverts the grouping of a hierarchical data source?

How would one write a LINQ query which takes a hierarchical source data and transforms it so that the grouping is inverted? Say I have a list of Topic objects each of which contains a collection of Tags which represent meta-data tags on that topic. What I need is to write a LINQ query to basically flip the hierarchy inside out so that I...

Generating a two level hiearchy from a set of data with more then one common grouping field in sql

My database is MS SQL 2008. I"m basically merging some sets of data together from two or more databases to end up with one owner of a set of data possibly related by two fields. Table ID Name Code 1 Ben 1 2 Ben 1 3 Frank 1 4 Frank 2 5 Mark 2 6 Mary 3 7 Chuck 3 8 ...