If I have a `users` table with effective dates, so the columns like this:
id, start_date, end_date
And I want to count the users that were active anytime in a filtered date range in sql I would just do
select count(distinct(id)) from users where start_date <= {end of range} and end_date > {start of range}
The values {end of range} and {start of range} would be based on whatever date filter the user selected in the dashboard - for example if they selected YTD {start of range} would be 2023-01-01 and end of range would be 2023-02-20
I can’t figure out how to do this in the metrics editor though. Is it possible?
Best answer by Moises Morales
View original