Re: Average New Users Per DOW

From: Robert DiFalco <robert(dot)difalco(at)gmail(dot)com>
To: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Average New Users Per DOW
Date: 2015-07-06 18:04:27
Message-ID: CAAXGW-wc2sDxrxYLjPd_Bsf=AbTYOTNO4g-44ufp6L1s-YN33g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Paul, I guess I'm not sure how a generate_series between 0 to 6
would solve this problem. Wouldn't I have to generate a series based on the
date range (by day) and then group by DOW _after_ that? Can you give me an
example of how I'd do it with a series based on 0 to 6?

On Mon, Jul 6, 2015 at 10:58 AM, Paul Jungwirth <pj(at)illuminatedcomputing(dot)com
> wrote:

> > 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
>
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2015-07-06 18:20:52 Re: Average New Users Per DOW
Previous Message Paul Jungwirth 2015-07-06 17:58:12 Re: Average New Users Per DOW