Welcome, Guest
Username: Password: Remember me

TOPIC: Aggregate data

Aggregate data 20 Feb 2012 12:10 #1396

  • kaoz84
  • kaoz84's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
I believe it's a good idea to think about the possibility to generate fields (in views) that create aggregate data.
For example, if I have some fields in DB table where you store your daily expenses, I would like to create,in a view with the grid, a field that bring me back the total expenses in the week or month.

it is already possible to do such a thing? if not, there are plans to implement it? :woohoo:
The administrator has disabled public write access.

Re: Aggregate data 20 Feb 2012 12:58 #1397

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Not in our plans at all.

It is very easy to write this in your component and there are several different ways to proceed it.
It depends if you want to sum
- filtered datas only (based on dates for example)
- only in current pagination
- all items.



We can immagine lot of functionnalities like that one, but I am affraid it is too much specific for Cook.
Let's see in the future if others users ask for this.


(In your case, a range of dates are also not handled yet in the filters)

TODO :
Create a predefined optimized query in your model that returns such data.
If you do it well in the model, it will be possible to get it from anywhere in your component.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: kaoz84

Re: Aggregate data 20 Feb 2012 13:09 #1398

  • kaoz84
  • kaoz84's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
Thanks for the speedy and accurate response. I will try to modify the model as you suggested.
Thanks a lot!! :D
The administrator has disabled public write access.

Re: Aggregate data 14 Oct 2012 06:44 #4463

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
How did you get on with gathering your aggregate data in your model?

TIP: If you're doing this you'll need to use SELECT DISTINCT your_field AS your_aliased_total in your joined data otherwise you'll get issues
Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 14 Oct 2012 06:49 by JoomGuy.
The administrator has disabled public write access.
The following user(s) said Thank You: admin
Time to create page: 0.063 seconds

Get Started