Dear all, 
I am looking for some advice in how to perform time aggregations, so far I 
have been able to aggregate only by hours or minutes but nothing between, 
for example every 10m, 15m and so on. For example this query count the 
number of fields aggregated by hours:
c = db.record.id.count()
s = db.record.created_on.year() | db.record.created_on.month() | db.record.
created_on.day() | db.record.created_on.hour()
rows = db(db.record.id > 0).select(db.record.created_on, c, groupby=s)
while in this case:
c = db.record.id.count()
s = db.record.created_on.year() | db.record.created_on.month() | db.record.
created_on.day() | db.record.created_on.hour() | db.record.created_on.
minutes()
rows = db(db.record.id > 0).select(db.record.created_on, c, groupby=s)
How I can make the above queries more flexible? Namely, in aggregating for 
different time frames, i.e., 10minutes, 400seconds and so?
So far, I've solved this issue by making a simple query but aggregation and 
then, counting and aggregating by hand. I hope there is a better and linear 
approach for that.

Regards
Paolo

 

-- 



Reply via email to