Filter the date according to the control

I would like to add a filter in the quick sight like departure_datetime(format 2023-05-03T17:15:00.000Z) should filter for next
0-15 days
15-30 days
30-60 days
60-120 days
120+ days
from today

how can I achieve this?

Hi @akashmanjunatha123 It will help if you can explain a bit more clearly what you want to achieve along with some sample data and output please? Thanks.

1 Like

@SD_QS I want to restrict my data wrt the departure data say i want only the data after 15 days from today, next 15-30 days like wise, i want to set this control to check my revenue data

Hey,

You can create a calculated field and add ifelse() in it.
Ex:
ifelse
(
{date} >= addDateTime(-30, ‘DD’, now()), ‘Past 30 days
{date} >= addDateTime(-60, ‘DD’, now()) and {date} < addDateTime(-30, ‘DD’, now()), ‘30-60 days’,
NULL
)

You can tweak the date range by changing the addDateTime() parameter.

Later on you can filter your visuals using this calculated field.

Hope this helps…….

1 Like

@akashmanjunatha123 let us know if the suggestion provided by @ajinkya_ghodake does the trick for you? In which case please mark his answer as the solution as it helps others in the community…

I tweaked a bit, it did help, thanks so much

Marking @akashmanjunatha123 's response as solution.

Regards,
Arun Santhosh