Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more datetime generalization functions #455

Open
pdobacz opened this issue Sep 27, 2022 · 0 comments
Open

Enable more datetime generalization functions #455

pdobacz opened this issue Sep 27, 2022 · 0 comments
Labels
low priority Low priority

Comments

@pdobacz
Copy link
Contributor

pdobacz commented Sep 27, 2022

Having cast(extract(minute from ts) as integer)) supported, there are the following expressions which we can't bucket by at the moment (coming from from Metabase):

day:
  CAST(last_seen AS date)

day of week:
	CASE WHEN (((CAST(extract(dow from last_seen) AS integer) + 1) + 6) % 7) = 0 THEN 7 ELSE (((CAST(extract(dow from last_seen) AS integer) + 1) + 6) % 7) END

week of year:
	ceil((CAST(extract(doy from CAST(date_trunc('week', last_seen) AS timestamp)) AS integer) / 7.0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority Low priority
Projects
None yet
Development

No branches or pull requests

1 participant