Use the variable of date range control (start date and End date) in formula

I want to use the result of the user input from the date range control. To filter my data, based on those dates (start and finish) I want to identify project name that are active between the date range selected by the user.

Here a example for my calculated field.

CASE

WHEN

(Start date <= FILTER_DATE_RANGE_START() and real_end_date >= FILTER_DATE_RANGE_START())

OR

(Start date <= FILTER_DATE_RANGE_END() and real_end_date >= FILTER_DATE_RANGE_END())

OR

(Start date >= FILTER_DATE_RANGE_START() and real_end_date <= FILTER_DATE_RANGE_END())

THEN “Actif”

ELSE “Inactif”

END

If you’re using Looker, this is possible with Liquid variables: https://cloud.google.com/looker/docs/best-practices/how-to-use-date_start-and-date_end-with-date-filters

If you’re using Looker Studio, this isn’t possible. Consider making a feature request!

1 Like