Closed (duplicate)
Project:
Flag
Version:
6.x-1.0-rc1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2009 at 14:50 UTC
Updated:
17 May 2009 at 16:05 UTC
First off, I love the flag module. Great work.
I'm trying to create a view of widgets that have been flagged in the last 24 hours...easy enough. The problem comes when I'm looking to sort them. I'd like to sort the widgets in order of # of flags DESC, but only consider flags that have occurred within the past 24 hours, not the # of total (all-time) flags for a widget.
Currently, the view will display all widgets flagged in the last 24 hours, but sorts them by TOTAL number of flags DESC.
Is there any trick to making the view sort on total flags within the past 24 hours? I'm assuming it would have to look at the flag_content table and ignore the flag_counts table.
Comments
Comment #1
mooffie commentedIf it's a tabular view that you want then you won't be able to do this using Views alone. Views is geared towards displaying existing data, not towards doing statistics using SQL's aggregation functions.
But if a simple listing is good for you, then once #371432: Exposing the flaggings table: Alternative Views support is done, you'll be able to do what you want using Views' "summary" mode. (Alternatively, the ViewsCalc module also comes to mind ...but it probably won't be needed.)
BTW, the last time I checked, Views couldn't sort by the "count" column (when doing a summary). It wouldn't hurt to file a feature request there. Perhaps somebody has already done this.
Comment #2
mooffie commentedIn a couple of days I'll mark this issue a duplicate of #371432: Exposing the flaggings table: Alternative Views support --unless anybody thinks it isn't so.
Comment #3
ipllc commentedThanks, mooffie. I'll look into ViewsCalc or wait out #371432.
Comment #4
mooffie commented(Using VIewsCalc too would require completing #371432: Exposing the flaggings table: Alternative Views support. When I said "alternatively", I meant that ViewsCalc might be an alternative to View's "summary" feature, not an alternative to #371432.)
Comment #5
mitchell commentedMarking as duplicate of #371432: Exposing the flaggings table: Alternative Views support.