CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • [SOLVED] Create a view of cases with date filters
Pages: [1]

Author Topic: [SOLVED] Create a view of cases with date filters  (Read 627 times)

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
[SOLVED] Create a view of cases with date filters
March 29, 2015, 06:11:14 pm
Hi folks,

Need: 
Create a view of open cases in specific time frame.

This view would filter on dates like: 
From 1.1.2015 through 1.31.2015 and return cases that were open during that time frame.

I scoured https://www.drupal.org/node/2301019#comment-9772821 and https://www.drupal.org/node/2252215
but think it is the null end date that is messing me up.

Any ideas on how to do this?
« Last Edit: March 30, 2015, 04:58:02 am by pmoz »

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Create a view of cases with date filters
March 29, 2015, 09:01:22 pm
Not sure if this gets close but in Views Filters, can't you make and 'and' or an 'or' group so it is basically

IF Start Date is greater than X

AND

IF End Date is less then X
OR
IF End date is null
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Create a view of cases with date filters
March 30, 2015, 04:56:04 am
Thanks for the reply Pete,

Don't know where I'm tripping up, but just can't get this.
Filters seem to take away any case with a start date earlier than specified date.

Created a brand new view of Cases.

Added only the Case Type field.

Created a relationship to contact id to display name of contact.

Added Display Name field to help better understand the filter results.

Added filters:
Start Date > X
and
End Date < Y
or
End Date is null

If I apply the filter to say 3.1.15-3.30.15 I only get the cases opened since 3.1.15.

So I kept playing around with combinations that made some sense to my now clouded mind.

Changed filters (see attachment):
Start Date < Y (changed exposed filter label to End Date)
and
End Date > X (changed exposed filter label to Start Date)
or
End Date is Null

This seems to work as expected.

I know I had tried this combination yesterday, but I must have not had the operators correct.

Now if I could sort them by Case Type name...

When I began this view, I thought this was the easy part!

Thanks again.
« Last Edit: March 30, 2015, 06:27:04 am by pmoz »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • [SOLVED] Create a view of cases with date filters

This forum was archived on 2017-11-26.