Questions tagged [grouping]

The process of grouping entities into collections of associated elements.

Grouping is a form of hierarchical knowledge representation, similar to mind mapping, concept mapping and argument mapping, all of which need to observe at least some of the principles of grouping.

SQL Server - Indicates whether a specified column expression in a GROUP BY list is aggregated or not. Read more about this

Wiki Links

7381 questions
12
votes
3 answers

Minimum-Waste Print Job Grouping Algorithm?

I work at a publishing house and I am setting up one of our presses for "ganging", in other words, printing multiple jobs simultaneously. Given that different print jobs can have different quantities, and anywhere from 1 to 20 jobs might need to be…
Matt Mc
  • 8,882
  • 6
  • 53
  • 89
12
votes
2 answers

Error incrementing crosstab dataset

I have a data source that is composed of object { groupName, rowName, colName, value }. I'm trying to put the fields row,col,val in a crosstab, separated by group [the group has headers]. A collection of the data objects is being stored as the main…
monksy
  • 14,156
  • 17
  • 75
  • 124
12
votes
3 answers

Use Collectors.groupingby to create a map to a set

I know how to create a Map> , using Collectors.groupingBy: Map> listMap = items.stream().collect(Collectors.groupingBy(s->s.key)); How would I modify that code to create Map>? Or can I not do it using stream…
simonalexander2005
  • 4,338
  • 4
  • 48
  • 92
12
votes
5 answers

Create string ranges from sorted array of integers

I have following sorted array of numbers (they can repeat e.g 21) let a = [1,2,3,4,7,8,12,15,21,21,22,23] And want to get following (sorted) array of strings with ranges let r =["1-4","7-8","12","15","21-23"] for consecutive numbers…
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345
12
votes
2 answers

Java Stream GroupingBy collect in custom object

I have a Temperature Class class Temperature { double minTemp; double maxTemp; String city; String country; } I have another class that maintains a collection of Temperature class Temperatures { List
user2578909
12
votes
2 answers

Golang: group and sum slice of structs

I come from the .NET world where I had LINQ so I could do in-memory queries like the one we usually see in SQL. I have a slice of this structure I want to group by 8 fields, and then sum another integer field. Something like: type Register struct { …
Marcos
  • 355
  • 2
  • 4
  • 10
12
votes
6 answers

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…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
12
votes
1 answer

What does n=n( ) mean in R?

The other day I was reading the following lines in R and I don't understand what the %>% and summarise(n=n()) and summarise(total=n()) meant. I understand the group_by and ungroup methods though. Can someone help out? There isn't any documentation…
Kashif
  • 3,063
  • 6
  • 29
  • 45
12
votes
6 answers

$week function and first day of week in aggregation

I use $project operator to extract week part from Date, then do grouping by weeks in aggregation pipeline: { $project: { year: { $year: [ "$datetime" ] }, week: { $week: [ "$datetime" ] }, .... } }, .... { $group: { _id: { …
12
votes
6 answers

Java : replacing text URL with clickable HTML link

I am trying to do some stuff with replacing String containing some URL to a browser compatible linked URL. My initial String looks like this : "hello, i'm some text with an url like http://www.the-url.com/ and I need to have an hypertext link…
Dough
  • 515
  • 1
  • 6
  • 20
12
votes
3 answers

Group by Sum in Excel

Let's assume that I have the following table in Excel A B Item quantity_sold A 3 A 4 A 1 B 5 B 2 D 12 C 3 C 7 C 8 and I need to sum up quantity_sold grouped by Item and print the results on the adjacent…
Ahmadov
  • 1,567
  • 5
  • 31
  • 48
12
votes
2 answers

ggplot multiple grouping bar

I would like to know how to get 9 grouping bar plot (3x3) together. My CSV: data <- read.csv("http://pastebin.com/raw.php?i=6pArn8GL", sep = ";") The 9 plots should be grouped according "Type" A to I. Then each grouped bar plot should have the…
S12000
  • 3,345
  • 12
  • 35
  • 51
12
votes
2 answers

Doxygen: How to include an element in multiple groups

The Doxygen documentation says that \ingroup can be used to add an entity to multiple groups: \ingroup ( [ ]) The problem is that I tried it and Doxygen adds the entitiy to just the last group in the group list.…
user2432986
  • 121
  • 1
  • 5
12
votes
3 answers

Nested aggregate functions with grouping in postgresql

I'm trying to get an average of sums using nested aggregate functions and grouping. What I would want to do is: SELECT AVG(SUM(x) GROUP BY y) WHERE ... GROUP BY ...; That is, for each row returned, I want one of the fields to be an average of sums,…
ferson2020
  • 3,015
  • 3
  • 18
  • 26
12
votes
1 answer

Datatables row grouping - how to add rowcount per group and expand/collapse all

I am using Datatables Collapsible/Expandable Grouping. http://jquery-datatables-row-grouping.googlecode.com/svn/trunk/collapsibleGroups.html I have configured it so that all groups collapsed in the initial view. I would really like to add the…
lbriquet
  • 541
  • 3
  • 12
  • 27