Restricting the selection on date range filter

I have a date range filter in my analysis How can I restrict the user to be able to select on date from 1 week past to 1 month future from current date.

Hello @Tanu_13 Hope this message finds you well!!

If I understand well your problem, you can restrict the date range filter to allow users to select dates only within a specific range by using calculated fields and parameter controls.

  • Create two calculated fields to define the start and end of the allowed date range.
StartDate = addDateTime(-7, 'DD', now())  -- 1 week past
EndDate = addDateTime(1, 'MM', now())    -- 1 month future
  1. Add a Parameter for the Date Filter:

    • Create a parameter (e.g., SelectedDate) of type Date.
  2. Add a Control for the Parameter:

    • Add a control for the SelectedDate parameter in your analysis, allowing users to select a date.
  3. Create a Filter to Restrict the Date Range:

    • Add a filter to your dataset to restrict the SelectedDate parameter to the calculated range.
    Filter Condition: 
    SelectedDate >= StartDate AND SelectedDate <= EndDate
    
  4. Apply the Filter:

    • Apply the filter to the visuals in your analysis.

Example:

Calculated Fields:

StartDate = addDateTime(-7, 'DD', now())  -- 1 week past
EndDate = addDateTime(1, 'MM', now())    -- 1 month future

Filter Condition:

SelectedDate >= StartDate AND SelectedDate <= EndDate

Please, tell me if this example works for u

1 Like

@lary_andr I tried following steps above but I get 2 different controls for start and end date but I want to have only 1 date range filter


Hi @Tanu_13,

Quick Sight does not have a feature to setup one control to handle multiple date’s to filter (like a range similar to your request).

You could try removing the end date control as controls do not need to be present for a parameter to be utilized.

Let us know if you have any additional questions; if we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!

Hi @Tanu_13,

Since we have not heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!