Data Analysis Journal

Data Analysis Journal

SQL

How To Create Date Series in SQL - Issue 32

Advanced SQL challenge on how to generate a time series in Postgres or RedShift.

Olga Berezovsky's avatar
Olga Berezovsky
Feb 17, 2021
∙ Paid

Let’s say you have a task to make a timeline of DAU (Daily Active Users) or users who purchased or subscribed daily. You’d need to prepare the data in the following format: 

If your table contains only user clicks or purchases on a given day, you might not have date values when users did 0 activity or no conversion. However, you need to extract those dat…

Keep reading with a 7-day free trial

Subscribe to Data Analysis Journal to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Olga Berezovsky · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture