-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
groupBy method should allow more control over method option #202
Comments
Could you give me a sample of your data? I'm not really sure why the year -- Irene On Thu, Jun 13, 2013 at 4:57 PM, Adam Savitzky [email protected]:
|
Yes, the year is being added up. It would be nice if there was a way to specify aggregators for all the columns, so this didin't happen. The data looks like this:
What I'd like to get is data that looks like this:
|
I want to be able provide a function for each of the columns I specify. Let me provide an example.
The following code doesn't work because it just does sum on the year column.
I end up with a view that looks like this:
Notice how the value for year is not 2010, which is what I want.
I'd like to propose an update to the method option in groupBy that allows me to pass an object with key being the column I'm aggregating by, and value being a function that determines the aggregation method. If none is specified, you get sum. I could rewrite my example above like so:
This would return:
Whatcha think? I'm open to other approaches too. What I'm trying to emulate is this SQL
The text was updated successfully, but these errors were encountered: