Trying to create a Drupal View that shows total number of days in a case.

There are two methods I'm considering:

First, I imagine if I could turn the case start date and end date into "Days Ago" within the view I could perform a math calculation of [end_date]-[start_date] to get the number.

The other method I thought may work would be to create an aggregate table through views that displayed a daily case load. For example, on 1.1.15 list these 5 people that have ongoing cases. On 1.2.15 list these 5 people that have an open case. From there, I could group by contact name and count.

Anyone have any ideas or done something similar?

1 Answer 1


Got it!

In Drupal added the Unix Timestamp format: Administration/Regional and Language/Formats/Add Format. For the string I put in U. Added the Date Type Unix Timestamp

In the View: Added the Start and End Date fields. Under Date Format selected the Unix Timestamp type I just created. Added a Math Expression field with the expression (([end_date]-[start_date])/86400) since there are 86400 seconds in a day.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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