grouping

sql missing rows when grouped by DAY, MONTH, YEAR

If I select from a table group by the month, day, year, it only returns rows with records and leaves out combinations without any records, making it appear at a glance that every day or month has activity, you have to look at the date column actively for gaps. How can I get a row for every day/month/year, even when no data is present, i...

WPF ListBox WrapPanel clips long groups

I've created a ListBox to display items in groups, where the groups are wrapped right to left when they can no longer fit within the height of the ListBox's panel. So, the groups would appear similar to this in the listbox, where each group's height is arbitrary (group 1, for instance, is twice as tall as group 2): [ 1 ][ 3 ][ 5 ] [ ]...

Ideal number of classes per namespace branch

What number of classes do you think is ideal per one namespace "branch"? At which point would one decide to break one namespace into multiple ones? Let's not discuss the logical grouping of classes (assume they are logically grouped properly), I am, at this point, focused on the maintainable vs. not maintainable number of classes. ...

Best generic strategy to group items using multiple criteria

Hello, I have a simple, real life problem I want to solve using an OO approach. My harddrive is a mess. I have 1.500.000 files, duplicates, complete duplicate folders, and so on... The first step, of course, is parsing all the files into my database. No problems so far, now I got a lot of nice entries which are kind of "naturaly groupe...

Algorithm for Grouping

I am trying to help someone write a program that I thought would be easy, but of course it never is :) I am trying to take a class roster (usually between 10-20 students) and effectivly uniquely pair off each classmate to another to make unique groups. Therefore in a class of 10 people, you can have 9 groups. It needs to be able to han...

Calculating grand totals from group totals in Reporting Services

I have some data grouped in a table by a certain criteria, and for each group it is computed an average —well, the real case is a bit more tricky— of the values from each of the detail rows that belong to that group. This average is shown in each group footer rows. Let's see this simple example: What I want now is to show a grand tota...

How to set the Taskbar Grouping Icon

When my application opens too many windows the taskbar groups them into one button. Each window has its own icon, but the grouping icon is the default "unknown"-kind icon. How can I set the grouping icon? ...

Group by two fields in Crystal Reports

how can i group by two different fields in a crystal report. Foe ex : val1|val2|val3|val6 val1|val12|val3|val7 val11|val2|val3|val8 val11|val12|val3|val9 i want the report to look like val1 : val2 val3|val6 val12 val3|val7 val11 : val2 val3|val8 val12 : val3|val9 ...

Wrap rows in Excel

Let's say there is a report to compare charges with adjustments that outputs to excel, such that each row has the following fields: Account Number charge date Original item number Adjusted Item number Original Qty Adjusted Qty Original amount Adjusted amount Original Post date Adjusted Post date I need to help a user create a view in...

Crystal Reports 8.5 grouping

I am grouping using a formula fCity which goes like this If {X.MailingCity} > "" Then {X.MailingCity} Else {X.City} I have two different fields in my view (Home City and Mailing City) Now, these fields contain many rural communities and in my report I want to have these smaller rural communities included with the major city it is locate...

displaytag, grouping and blank lines

I'm looking for a way to do grouping with displaytag but with the group title separated from the detail. It's probably not all that clear, so here is an example : If I just add groups to a displaytag table, I end up with something like : | group1 | item1 | | | item2 | | | item3 | | group2 | item4 | | | item5 | I ...

Query: count multiple aggregates per item

Often you need to show a list of database items and certain aggregate numbers about each item. For instance, when you type the title text on Stack Overflow, the Related Questions list appears. The list shows the titles of related entries and the single aggregated number of quantity of responses for each title. I have a similar problem b...

Algorithm to match preferred partners into groups of three

What's a good algorithm to solve this problem? I have three groups of people - group A, group B, and group C. There are the same number of people in each group. They each have a list of people in the other groups that they're willing to work with. I want to group all these people together in groups of 3 (one from A, one from B, and one ...

SQL grouping

I have a table with the following columns: A B C --------- 1 10 X 1 11 X 2 15 X 3 20 Y 4 15 Y 4 20 Y I want to group the data based on the B and C columns and count the distinct values of the A column. But if there are two ore more rows where the value on the A column is the same I want to get the maximum valu...

LINQ grouping/subquery to fill a hierarchy data strcuture

I have a DataTable that queries out something like below usergroupid...userid......username 1.............1...........John 1.............2...........Lisa 2.............3...........Nathan 3.............4...........Tim What I'm trying to do is write a LINQ statement that will return an array of UserGroup instances. The UserGroup class h...

Which SQL statement is faster? (HAVING vs. WHERE...)

SELECT NR_DZIALU, COUNT (NR_DZIALU) AS LICZ_PRAC_DZIALU FROM PRACOWNICY GROUP BY NR_DZIALU HAVING NR_DZIALU = 30 or SELECT NR_DZIALU, COUNT (NR_DZIALU) AS LICZ_PRAC_DZIALU FROM PRACOWNICY WHERE NR_DZIALU = 30 GROUP BY NR_DZIALU ...

Fast Entity Grouping (by location) algorithm

I'm dealing with a large group of entities that store locations. They are displayed on a map. I'm trying to come up with an efficient way to group near located entities into one entity when viewed from a higher location. So, for example, if you are very high, when looking down, you will see one entity that represents a group of closely l...

xsl grouping sort problem

Hi I have the following xsl template that I'm using to group my xsl. The problem I have is that I need to uppercase the @Title as currently my grouping is seeing upper and lowercase as seperate groups. <xsl:key name="rows-by-title" match="Row" use="substring(@Title,1,1)" /> <xsl:template name="Meunchian" match="/dsQueryResponse/...

Can you toggle grouping in a Crystal Report?

Is it possible to have a report which has grouping on the underlying data but for which you can disable the grouping via a button or something on the report? Basically I want to have a "Summary Report" which is grouped, but then be able to view the detail beneath when required without having a separate report for it. ...

How can I break a table row in xsl after a specified count?

Hi I have the following xsl that sorts my xml alphabetically: <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <xsl:key name="rows-by-title" match="Row" use="translate(substring(@Title,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')" /> <xsl:variable name="StartRow" select="string('&lt;tr &gt;')" /> ...