Re: Average New Users Per DOW

From: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Average New Users Per DOW
Date: 2015-07-06 17:58:12
Message-ID: 559AC1B4.3040501@illuminatedcomputing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I'm not sure how to create a result where I get the average number of
> new users per day of the week. My issues are that days that did not
> have any new users will not be factored into the average

This is a pretty common problem with time-series queries when there is
sparse data. My go-to solution is to use generate_series---in your case
from 0 to 6---then do a left join from there to your actual data.

Paul

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert DiFalco 2015-07-06 18:04:27 Re: Average New Users Per DOW
Previous Message David G. Johnston 2015-07-06 17:42:14 Re: PgBouncer error - psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.6432"?