Quicksight Date Filter and Control

Hi @avid_learner , thanks for your question.

Relative to the current time, I want to display the values from the latest as_of that is available. For example,

  1. if current time is between 01:03 to 01:17, I want to show the rows with latest as_of 1:00
  2. if current time is between 01:18 to 01:32, I want to show the rows with latest as_of 1:15
  3. if current time is between 01:33 to 01:47, I want to show the rows with latest as_of 1:30

Based on your desired outcome description, I have two ideas.

Note: the screenshots below are taken around Mar 5 00:09 UTC


Idea A: Create a calculated field flag based on the time diff between current time and the as_of timestamp. If the time diff is between 3 and 17, set it to “y” otherwise “n”. Use the calculated field to filter.

ifelse(
    dateDiff({as_of}, now(), "MI") >= 3 AND dateDiff({as_of}, now(), "MI") <= 17,
    "y",
    "n"
)


Idea B: Use top N filter on as_of timestamp with minute granularity
If filtering to the most recent as_of timestamp based on the minute portion is good enough for your requirement, use the filter like following. But note that this always displays the rows with most recent timestamp, regardless of the 3-to-17 minutes trailing window.


Please let me know if this helps.