superset icon indicating copy to clipboard operation
superset copied to clipboard

[SIP-22] Proposal for changes to time filter to allow for more flexible time range selections

Open vylc opened this issue 7 years ago • 10 comments

[SIP] Proposal for changes to time filter to allow for more flexible time range selections

Motivation

Time is a first order dimension and the primary way to filter datasets. A few issues that need to be resolved:

  1. It is currently impossible to specify commonly filtered time ranges on recurring charts and dashboards. (ie. last full week, etc.)
  2. It is unclear to users what time ranges are being specified
  3. Date ranges are conflated with date+time ranges

Currently in Superset, there are a few different ways to specify a time range for a set of data in Explore View: Screen Shot 2019-05-21 at 1 34 11 PM

On the ‘Defaults’ tab, there are a few options here:

  1. No filter - no specified range; return all data
  2. All other options are presets filtering on time ranges relative to today. The units of time referenced here convert to # of days. For example:
  • Week = 7 days
  • Month = 30 days
  • Quarter = 90 days
  • Year = 365 days
Screen Shot 2019-05-21 at 1 34 46 PM #### On the ‘Custom’ tab, there are 2 options: 1. Relative to today is similar to Defaults, however this is flexible enough historical and future looking as well as controls on units of time 2. Start/End is pretty self explanatory. The one notable element here is the ability to use English to express time; however this is somewhat limited #### All date/time ranges start at 00:00:00 time

Proposed Change

The main issues we need to solve are:

  • Ability to specify relative dates that are not relative to today
  • Ability to specify start of time units
  • Clearly display time ranges being filtered for (Nice to have - improve usability by adding more common default time ranges)

Changes to Defaults tab

  1. Modify Defaults tab to organize by unit of time
  2. Add clarifying time range selected
  3. Augment default time ranges
  4. Add Week Start Date
  5. Modify months to be interpreted as calendar months (otherwise use weeks)
Screen Shot 2019-05-28 at 12 10 25 PM Screen Shot 2019-05-28 at 12 12 04 PM

Changes to Custom tab

Mostly, the same with the following modifications:

  1. Add ability to anchor to specific date (defaulted to Today)
  2. Show selected time range
  3. Keep ability to do “english” language times (ie. 6 hours ago, now, etc. through Start/End dates)
Screen Shot 2019-05-28 at 12 14 51 PM

New or Changed Public Interfaces

  • Will need to keep superset tables that at minimum contain calendar months (ie. how many days in each month, etc.) if not standard time tables if eventually we want to get fancier with time ranges

vylc avatar May 28 '19 19:05 vylc

Issue-Label Bot is automatically applying the label #enhancement to this issue, with a confidence of 0.91. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar May 28 '19 19:05 issue-label-bot[bot]

@mistercrunch @xtinec @john-bodley @datability-io @betodealmeida

vylc avatar May 28 '19 19:05 vylc

@john-bodley i think this is compatible with SIP-15's proposal. Am fine disregarding time in the Defaults->DAY and above unit of time options

vylc avatar May 28 '19 19:05 vylc

@vylc I think these changes make a lot of sense and touch on some aspects of SIP-15 regarding explicit callout. A few comments/thoughts:

  1. It's also worth pointing out that the current relative timestamp sometimes uses now and other times uses today as the reference point which is somewhat confusing.

  2. Related to SIP-15 should we align on supporting dates and timestamps or just make everything timestamps? I proposed the former in SIP-15 but I'm not opposed to the later. Note there are other temporal grains; week, month, quarter, year etc. however we (and other BI tools) normally just encode these as dates (or timestamps), i.e., 2019-01 or 2019-Q1 is defined as 2019-01-01.

  3. For DAY I'm not sure that "Today so far (now)" should reference now as we're talking about dates and not times. I'm uncertain whether it should be [, today) (exclusive of today) or [, tomorrow) (inclusive of today).

  4. We need to ensure that the time window is apparent when the widget is closed.

  5. From a UX perspective we're really specifying a time window either as: i) a start and and end, ii) a start with a duration, or iii) and end with a duration, and was wondering whether there was merit in trying to design/encode this into the widget somehow (which ties into #4).

  6. We also have a time grain selector and wonder if it make sense to keep these decoupled or somehow combine them. I guess you could have a monthly time grain but the time filter is based on years (as opposed to months).

john-bodley avatar May 29 '19 17:05 john-bodley

Also here is Looker's various date/time filters which provide some additional context regarding the various patterns they support.

john-bodley avatar May 29 '19 17:05 john-bodley

I really like this proposal, as I often find myself needing an interval that isn't available. I recently opened a PR which solves a subset of this problem, namely the now/today one ( #7525 ), but I do feel that Superset would benefit a lot from adding more functionality in this space. I would like to add that Last Month or similar might mean very different things to different people; for one it means a moving window(e.g. 2019-04-30 to 2019-05-29) , while for others it usually means last full period (2019-05-01 to Today). This is often tightly coupled with time grains, and probably benefits from anecdotal analysis where the current functionality was insufficient.

villebro avatar May 29 '19 18:05 villebro

Thanks for sharing this proposal! In the future when proposing a change to UX of the tool please add the label design-review.

  1. The number of defaults under for example the Default - Today tab is overwhelming. We should draw a thoughtful line around how many options we provide users. The more choices a user is presented with, the longer the user will take to reach a decision. Check out Hick's Law.
  2. This feels like a move towards supporting power user needs over general usability. It should be noted this provides greater friction for the non-power user. Having to select Today, Day, Week of Month first to find a specific default is not as user friendly/discoverable as it exists today. I question if some aspects of this should this live behind a more advanced option and/or feature flag for the time filter?
  3. I appreciate that you're trying to provide greater clarity of the selected time range for the user. The placement of the what I would suggest calling "Selected Time Range" looks like a bit of an afterthought right now. My guess is this a limitation of the tool you're using to mock this up in. It would be worth thinking about the hierarchy of information here. Rank it and order it as such. I would probably place the selected time range first. I think this is a great add all around.
  4. Week Start Day under Defaults > Week/Month is a bit hidden and unless I'm mistaken should probably be closer to the Today, Day, Week, Month selector.

elibrumbaugh avatar May 29 '19 20:05 elibrumbaugh

• I like that we explicitly note the time range selected. The placement feels a little weird though; would like a design pass. Agreed with @john-bodley's point above that we should show this after selection as well. • I’m not sure about the [Today, day, week, month, year] drop-down in the defaults. It took me a while to grock, and I wondered at the number of defaults (could it lead to the paradox of choice?). It feels sufficiently complex that it feels like more than “Defaults” i.e. starts feeling "Custom." I think it's worth re-considering how we group these options at the highest level (relative / absolute seem like bigger distinctions, possibly). • I like all the changes to custom tab • I may be missing something, but I don’t think this actually solves the “Ability to adjust start time.” We could do that by adding a custom for the start date

sylvia-tomiyama avatar May 29 '19 22:05 sylvia-tomiyama

@vylc @sylvia-tomiyama If there is alignment on the solution and it can be clearly documented I can take a pass at visually representing it. I don't have the cycles to get involved in the discussion or wait for it to land but I can mock up once we have a clear and unified vision.

Sylvia, note It might take time away from GMUI support as we try to launch.

Feel free to tag me here when it's ready.

elibrumbaugh avatar May 31 '19 20:05 elibrumbaugh

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Jul 30 '19 20:07 stale[bot]