Entering a relative date range (in a report writer)
Our company's B2B web app includes a simple report writer where advanced users can save simple reports that other users can run. Currently, every report includes a date range that users must fill in when running the report.
Our report-saving users would like the ability to define reports that pre-define a relative date range, to enable reports like "Sales for the previous month" or "Transactions in the last 30 days" where users who run reports won't have to enter the date range every time.
I've found good ideas (on UX.SE and elsewhere) for entering relative dates, but I'm stumped about UX for entering relative date ranges.
Some example date ranges I'd like to enable:
- Today (0:00 today through now)
- Yesterday (0:00 - 23:59:59 yesterday)
- In the last 90 minutes (relative to now)
- In the last 7 days (relative to now)
- In the last 7 days (meaning full days: 0:00 8 days ago through 23:59:59 yesterday, but not including today since it's not done yet)
- The 4th quarter of last year
- Last week (Sunday through Saturday)
- 4 weeks ago (Sunday through Saturday)
- Jan 1 2016 through Jan 15 2016 (even though our advanced users want relative date ranges, absolute date ranges are still the most common use-case!)
My initial idea is to use a dropdown box to choose various date range options, including:
- Range - absolute range would still be the default since it's the most common case
- Choices for each of the top 4-6 most common relative cases e.g. Yesterday, Today, Last Week, Last Month, etc.
- A "Relative Range" option to handle less common cases like "the last 30 minutes" or "4th quarter of last year".
But I'm stumped on what that "Relative Range" UX could be. Got suggestions?
I'm particularly struggling with the fact that ranges can either be aligned on boundaries (e.g. last month meaning the 1st through the last day of the month) or not aligned on boundaries (e.g. 90 minutes ago relative to now). How to help the user express which option is desired? And in the bounded case, how can the user declare what the boundary is (e.g. hour, day, etc.)?
The users who are saving reports in our system are smart but often very non-technical. Many don't even have good Excel skills. They are certainly not programmers. UX simplicity will be important for success here.