Jump to:
| Project: | Date |
| Version: | 7.x-2.x-dev |
| Component: | Views Filter |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Submitting this as a feature request because I can't find an existing request for this functionality and it would really help in a lot of different use-cases:
We need a way to control date granularity on views aggregation settings. Currently date fields aggregate at the lowest level of the date field, which makes aggregation essentially useless when you want to aggregate on a date field. For example: I have nodes with a year-month-day date field and I want a simple view that shows me how many nodes exist with date field values for each year. I want:
2012: 47 nodes
2011: 122 nodes
2010: 34 nodes
I dive in and configure my view, setting up the typical aggregation settings needed for this type of thing. I hit a snag when I realize that the view is grouping on the full date field, aggregating only the rows that have the exact same month/day/year.
Something like http://drupal.org/project/views_date_format_sql, only for date module fields, not just system dates.
If anyone can inform me on how to aggregate my date field values by year only, that would be awesome; we can close this request.
Comments
#1
I would also be interested in this functionality.
I am using views Highcharts and also notice that it only takes the full date also because I entered in several date formats and they all returned the same view no matter which date format I used
thanks !
Nick
#2
I'm working on a sports site and this granularity would be perfect for aggregated stats displayed by year/season. Any ideas for a workaround?
#3
I would love to find one too.
but I don't think this works at all yet.
#4
I am willing to work on this if someone can help me get started fixing this issue
thanks !
#5
I am really interested in getting this functionality going is there any one that would want to help put this together ?
thanks
#6
I think you should take a look at Views Date Format SQL module. This could be a good starting point.
#7
thanks for the tip @Norberto Ostallo but it doesnt work with date field anymore the functionality got left behind somewhere http://drupal.org/node/1830436
Can you think of any other options ?
thanks again
#8
http://dev.client.gotpantheon.com/graph_example
Here is an example of the graph I am trying to build this should be 2 plots october and november with totals of all that fall on that month
Instead views outputs all of them and shows there respective month ?
thanks for any help
Nick
#9
+1
#10
*Bump* This feature would be incredibly useful!
#11
+1, can't do anything without it for reporting sites
#12
same here
there seems to be a workaround:
I use a table layout, enabled aggreation, added field "nid" with "Count distinct".
I then add a sort by "post date" with "monthly" granularity.
Then I added a "post date" field with custom format "M-Y". I select "min" instead of "group results together.
#13
yeah I would like this for sure !
#14
@mototribe: Thank you very much! Your workaround is working(views 3)!
This issue should be noticed by maintainers
#15
No, not working. Showing minimum as expected.
#16
@mototribe: I tried your workaround for my views aggregation and it worked so long as I only used a date sorting and did not add a field with the date included. I'd say RoSk0's concern is still worth looking into.