Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Aggregate data 20 Feb 2012 12:10 #1396

  • kaoz84
  • kaoz84's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 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:

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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 following user(s) said Thank You: kaoz84

Please Log in or Create an account to join the conversation.

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

  • kaoz84
  • kaoz84's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
Thanks for the speedy and accurate response. I will try to modify the model as you suggested.
Thanks a lot!! :D

Please Log in or Create an account to join the conversation.

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

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
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!!!
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Last edit: by JoomGuy.
  • Page:
  • 1
Time to create page: 0.064 seconds

I would like to Thank you for the Speed and the Quality of your work.
Pantelis (Forum)

Get Started