aggregation

Data aggregation - multiple websites, single superuser site

I have a requirement for a set of asp.net MVC websites as follows: Multiple sites, using the same codebase, but each site will have a separate database (this is a requirement), and users will login and enter data. A single site for super users where they log in and work on data aggregated from each of the individual sites. The number...

Referencing MySQL Alias of Aggregate Column

Following up on my question summarizing-two-conditions-on-the-same-sql-table, I added a RATIO column that is simply one SUM(...) column divided by a second SUM(...) column: SELECT COMPANY_ID, SUM(CASE WHEN STATUS IN (0, 1) THEN 1 ELSE 0 END) AS NON_BILLABLE, SUM(CASE WHEN STATUS IN (2, 3) THEN 1 ELSE 0 END) AS BILLABLE S...

django aggregate aggregated fields?

I have a model called Item, with m2m relation to User ("owner"). For each item, i need to count users who own it. That's easy enough with annotate() But then i need to calculate ratio between owners of specific gender and total owner count for each item. For example if, 2 males own the item out of 5 users, the ration is 0.4. What's th...

Very simple bar graph

First I will have to apologise for my ignorance as I'm sure this is a very simple question but I am very new to R. My question is that I have a data frame that looks like this; countrydes Insured USA 4500 CANADA 4500 USA 7500 CANADA 7600 All I want to do is aggregate the sum of...

Aggregating SQL rows with precedence

I have a table full of items from different sources. Some of the sources might have the same location (in my example, different BBC news feeds would be different sources, but they all come from the BBC). Each item has a "unique" ID which can be used to identify it among others from the same location. This means that items relating to the...

Django aggregation get_*_display function usage

Hi all, This question relates to Django Aggregation/Annotation in 1.1. Suppose I have a simple model with an IntegerField that has a "choices" parameter passed to it. In this case, it maps to a GENDERS tuple as shown. Normally, in a template (or view) I can refer to the textual value of the gender by using the get_gender_display() f...

To aggregate or not to aggregate, that is the database schema design question

If you're doing min/max/avg queries, do you prefer to use aggregation tables or simply query across a range of rows in the raw table? This is obviously a very open-ended question and there's no one right answer, so I'm just looking for people's general suggestions. Assume that the raw data table consists of a timestamp, a numeric foreig...

Managed COM aggregation

It is my understanding building a COM object aggregating an existing COM object implies implementing redirection logic in the IUnknown.QueryInterface method of the outer object. The question I have is how to do that if the object you are building is managed. On managed objects IUnknown is not explicitly implemented COM Interop does it f...

Code based examples on difference between Aggregation, Composition and Dependency.

What is the difference between different types of association i.e. aggregation, composition and dependency? explain with the help of code examples(in java, C++ or pseudo code). ...

Ruby on Rails: Aggregating several columns into an Array

I'm developing a Ruby on Rails app where one of my database tables has 10 columns (pile_1 through to pile_10). It would be convenient to access these columns in the model as a 10-element Array. It feels like I should be able to coerce composed_of into doing what I want, but I can't figure out how. Can anyone enlighten me, or suggest a b...

How to aggregate analytics from Google, Twitter, YouTube, Facebook, etc

I have a video blog for which I would like to track certain statistics, including stats from Google Analytics, Twitter, YouTube, Facebook, etc. The problem is that the various stats are on different websites, which require different logins, etc. It takes a long time to actually view everything. I am looking for a way to be able to aggre...

algorithm to update an aggregated value when an element changes

(I'm using C# but this isn't necessarily platform-specific) Say I have a table of values, which are indexed by a triplet of keys (A, B, C). The values in the table are streaming in from an outside source at sporadic intervals. I want to publish aggregates over various sets of keys, e.g. calculate a sum over all values where B = b1. Thi...

Aggregate and Query the RSS feeds, simply quickly and save the queries

Ok I know about YQL, Yahoo Pipes and all that. But I am wondering what is the "shortcut" for someone who knows jQuery and javascript and JSON pretty well ? What would be the architecture of the generic solution using these tools to aggregate several rss feeds, and then query the result ? I would like to be able to save these queries an...

Don't understand why these two queries give different results

I have three tables (for sake of argument) individual, email and attribute. individual_Ref the foreign key that links individual to email and attribute. It isn't necessary for a given individual to be represented on the attribute table as they may never have had an attribute added and they can appear more than once if they have more tha...

How To Aggregate API Data?

Hi, I have a system that connects to 2 popular APIs. I need to aggregate the data from each into a unified result that can then be paginated. The scope of the project means that the system could end up supporting 10's of APIs. Each API imposes a max limit of 50 results per request. What is the best way of aggregating this data so that...

Aggregating RSS Items in Java

I'm trying to build a polling service in Java that checks for updates from a RSS feed. On detecting new items, it should only send new items further on in the system. Is there an API that does this or would I have to do the comparison checks myself? At the moment, my poller just returns what it currently sees causing duplicates in my ...

Oracle - Group-level summaries

I am trying to create a report that has a summary for each group. For example: ID NAME COUNT TOTAL TYPE ------------------------------------------------------------- 1 Test 1 10 A 2 Test 2 8 A ...

Are there any existing batch log file aggregation solutions?

I wish to export from multiple nodes log files (in my case apache access and error logs) and aggregate that data in batch, as a scheduled job. I have seen multiple solutions that work with streaming data (i.e think scribe). I would like a tool that gives me the flexibility to define the destination. This requirement comes from the fa...

Hierarchy based aggregation

I have a hierarchy table in SQL Server 2005 which contains employees -> managers -> department -> location -> state. Sample table for hierarchy table: ID Name ParentID Type 1 PA NULL 0 (group) 2 Pittsburgh 1 1 (subgroup) 3 Accounts 2 1 4 Alex 3 ...

Dependency injection and aggregation/association

In both association and aggregation, one class maintains a reference to another class. Then, does constructor injection imply composition? Going by the same logic, is it safe to say that setter injection leads to an association, and not an aggregation? ...