1

I would like to display a table or graph showing revenue over the last year with sums divided into weeks or months.

I record every sale/value in an entity, and can show ie "total this week" or "total this year" with Views and aggregation, but I would like to show it like "this week", "last week", "last week -1" without having to make a view or attachment for each value.

Is this possible without making a new entity ?

Notes:

  • I want to use Views, but I wonder if there is a way to group/aggregate values without having to make a new view for each aggregation (week or year). Then I will have to make 52 views/attachments for showing weeks and 12 to show the year.
  • I can create a date field in my view and format it as year-month eg 2014-12 and then group by that and use aggregation. But then I will have to make one for 2014-11, 2014-10, 2014-09, etc
  • 1
    why don't you want to use views ? Where do you want the table ? on a page or in a block on a node etc ? – jowan sebastian Dec 5 '14 at 23:32
  • I want to use views, but I was wondering if there is a way to group/aggregate values without having to make a new view for each aggregation (week or year). Then I will have to make 52 views/attachments for showing weeks and 12 to show the year. – HansP Dec 6 '14 at 0:01
  • perhaps you can create a date field in your view and format it as year-month eg 2014-12 then you can group by that and use aggregation. – jowan sebastian Dec 6 '14 at 0:04
  • Yes, that I can do, but then I will have to make one for 2014-11, 2014-10, 2014-09 etc. – HansP Dec 6 '14 at 0:09
0

"Date Views" (date_views) sub-module of the Date module extends the "Configure filter criterion" used in Views. It allows for using "Relative dates" that are computed when the view is displayed.

Some examples are:

  • now
  • now + 1 days
  • -2 months
  • Monday next week
  • ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.