Answers.Body: <p>Certain ones can work by just adding option values, but I don't think everything. For example @andy-clark you can do prior 6 months as "ending_6.month" which is supported by the default clause here <a href="https://github.com/civicrm/civicrm-core/blob/5.20.2/CRM/Utils/Date.php#L1660" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/5.20.2/CRM/Utils/Date.php#L1660</a></p>
  
  <p>Take a look through that function to get an idea of what works, in particular the default clauses in each section.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T02:45:13.743Z
Answers.Text: thanks  for the answer.. but I'm no coder and that is all unintelliglbe to me sadly.  But since I now know that some do work I can experiment and see.  thanks for the guidance
Answers.UserDisplayName: Robinnz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T03:02:29.400Z
Answers.Text: Ok. In general the "ending" ones will work, but "ending" is different than "previous" in your question. So "ending_3.year" will give you three years back from today, as opposed to (if it worked) "previous_3.year" which would be 2016-2018.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T18:47:10.863Z
Answers.Text: Thanks!  Last 6 months added
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-16T00:07:03.890Z
Answers.LastActivityDate: 2019-12-16T00:07:03.890Z
Answers.UserDisplayName: Demerit
Body: <p>I've stumbled across the options in  <strong>Administer - System Settings - Option Groups</strong> and I read somewhere that you can create new ones.. so I tried using the syntax of existing options:</p>
  
  <p>eg Previous 2 calendar years = "previous_2.year"<br>
  so I tried  Previous 3 calendar years = "previous_3.year"</p>
  
  <p>but that didnt work- just returned empty results (tried lots of others and they all did the same)</p>
  
  <p>any clues please?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-15T22:12:21.360Z
Comments.Text: I think the intention was for users to be able to create new relative date filters, but it didn't happen (yet) AFAIK. Not sure what these option values are doing. Personally I'd love a relative filter that was '6 months ago'
Comments.UserDisplayName: Andy Clark
Tags: <search><dates>
Title: How to create new Relative Date Filter?
ThreadText: # How to create new Relative Date Filter?
  
  (Asked by: username_0 on 2019-12-15)
  
  I've stumbled across the options in **Administer - System Settings - Option Groups** and I read somewhere that you can create new ones.. so I tried using the syntax of existing options:
  
  eg Previous 2 calendar years = "previous\_2.year"  
  so I tried Previous 3 calendar years = "previous\_3.year"
  
  but that didnt work- just returned empty results (tried lots of others and they all did the same)
  
  any clues please?
  
  **Tags:** search, dates
  
  > **Comments:**
  > **username_1**: I think the intention was for users to be able to create new relative date filters, but it didn't happen (yet) AFAIK. Not sure what these option values are doing. Personally I'd love a relative filter that was '6 months ago'  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-12-16. Score: 3
  
  Certain ones can work by just adding option values, but I don't think everything. For example @andy-clark you can do prior 6 months as "ending\_6.month" which is supported by the default clause here <https://github.com/civicrm/civicrm-core/blob/5.20.2/CRM/Utils/Date.php#L1660>
  
  Take a look through that function to get an idea of what works, in particular the default clauses in each section.
  
  > **Comments:**
  > **username_0**: thanks  for the answer.. but I'm no coder and that is all unintelliglbe to me sadly.  But since I now know that some do work I can experiment and see.  thanks for the guidance  
  > **username_2**: Ok. In general the "ending" ones will work, but "ending" is different than "previous" in your question. So "ending_3.year" will give you three years back from today, as opposed to (if it worked) "previous_3.year" which would be 2016-2018.  
  > **username_1**: Thanks!  Last 6 months added  
  
  ---
  
  