Questions tagged [aggregates]

Aggregate functions, typically found in SQL, derive summary values from multiple rows in a single column.

An aggregate, more commonly known as an aggregate function, is a means to examine the values found in multiple rows from a single column. These are grouped together as input on certain criteria to form a single value of more significant meaning or measurement, such as a set, a bag or a list. Aggregates are usually found in SQL.

179 questions
1
vote
1 answer

How do I write these using pipes in R?

How do I get subgroups by using pipes? I don't understand why what I wrote doesn't work. Can someone explain how these work, reading online and seeing examples online hasn't help me because I am not sure what I am not…
Don'tKnow
  • 55
  • 3
1
vote
1 answer

How can I create and use new function in DataFrame?

How can I create new function and use this new function in my DataFrame, so as to add new column during aggregation ? From my DataFrame I took "Wind direction" and "Temperature" and for these columns I want to aggregate it and create table with mean…
dingaro
  • 2,156
  • 9
  • 29
1
vote
1 answer

Should Domain Entities always be loaded in their entirety?

I have a custom ASP.NET Membership Provider that I am trying to add password history functionality to. User's passwords expire after X days. Then they have to change their password to one that has not been used in their past X changes. I already had…
mikesigs
  • 10,491
  • 3
  • 33
  • 40
1
vote
1 answer

Entity framework core with value objects

I'm are running in an problem by using aggregates and value object in combination with EF7. This is the aggregate: public class MasterAgreement { private string _name; public Guid Key { get; set; } public MasterAgreementRaise…
1
vote
1 answer

How to select from table where text box = formula with aggregates (Xojo+ SQLite)

I have a table with columns; Fullname, GroupNo, Tdate, Schedule, Cramount, Dramount, Iamount. I want to select those columns where textbox111.text is greater than formula SUM(Cramount)*26/(SUM(Dramount+Iamount)). The SQL below give me syntax…
1
vote
1 answer

How to define aggregate roots from a relational model in order to use it for DDD?

Ive looked quite a while at others posts in there relativly to aggregates roots. It seem that i don't understand at all how to define in the right way aggregates roots. I saw answers such as aggregates roots might not be aggregates roots and vice…
Rushino
  • 9,415
  • 16
  • 53
  • 93
1
vote
1 answer

Using shared IDs among one-to-one related domain aggregates

Is it a reasonable pattern to use shared GUIDs as aggregate IDs for root aggregates that have a one-to-one relationship? I'm not immediately seeing any reason not to other than clarity. For example, I have an Organization Membership bounded context…
platypusjh
  • 667
  • 1
  • 7
  • 16
1
vote
1 answer

Where is the proper place to put domain logic to update a child of an aggregate root?

Is it a best practice to update children of an aggregate root directly, or only through its aggregate root? For example, which is preferred: Order.UpdateOrderLineQuantity(orderLine, quantity); or Order.OrderLines[0].UpdateQuantity(quantity); Any…
Jason
  • 2,701
  • 2
  • 25
  • 35
1
vote
0 answers

How to calculate the max of a version kind of field in postgresql?

I have a table like this: Category Version B 1.8.11 B 1.20.138 B 1.29.01 B 1.30.89 B 1.3.114 Now, I want to get the latest version. By default, order by doesn't work because 1.8.11 is treated the highest. I understand one way is to…
Isha Garg
  • 331
  • 1
  • 3
  • 12
1
vote
2 answers

Django - Time aggregates of DatetimeField across queryset

(using django 1.11.2, python 2.7.10, mysql 5.7.18) If we imagine a simple model: class Event(models.Model): happened_datetime = DateTimeField() value = IntegerField() What would be the most elegant (and quickest) way to run something…
Hal
  • 537
  • 4
  • 13
1
vote
1 answer

XQuery Nested Query

I can't figure out how to execute this query: Using XQuery, For each rep number, output: A. firstname, lastname of the rep. B. customer name for each customer associated with the rep. C.total amount of money (excluding tax) billed for all customers…
1
vote
1 answer

SQL Server 2008 sum values of a column, each in two tables based on key values of one table

Say I have 2 tables: T1 with composite keys DOC, VER, SN1 DOC VER SN1 NME ISU --- --- --- --- --- AP 03 5 COM 2 AP 03 4 COM 3 AP 03 3 ITC 2 AP 02 4 PUR 10 AP 02 2 PUR 5 AW 03 2 EXP 4 AW 03 …
Tres
  • 31
  • 5
1
vote
1 answer

Retrieve only the queried object from nested array in MongoDB

Having the following document in my Mongo I'm trying to get the object with specified id. Here is my Mongo document. Mongo version: 2.6 { "_id" : ObjectId("57c1ae9ac1bd31d4eb4d546d"), "footers" : [ { "type" : "web", …
Ihor Patychenko
  • 196
  • 6
  • 19
1
vote
2 answers

SQL Server aggregate over range of dates

I am using SQL Server 2014. I need to aggregate totals (sum total) over a range of dates that are partitioned or grouped by customer and location. The key is to get all the adjustment amounts and sum them up as they apply to a billing transaction…
shawno
  • 343
  • 1
  • 3
  • 17
1
vote
1 answer

Aggregate group inside group in MongoDB

With aggregate I retrieve all my data grouped by day, this way: db.collection('checkpoint').aggregate [ { '$match': {'id_journey': journey.id_journey} }, { '$sort': { 'when': 1} }, { '$group': { '_id': {…
shaithana
  • 2,470
  • 1
  • 24
  • 37