Hi Kevin!
Maybe you can make another dataset where you "turn the query around"?
Like
select case when purchase_amount between 0 and 10 then '$0-$10' when
purchase_amount between 10 and 20 then '$10-$20' ... end as frequency,
count(distinct customer_id) as customers from orders group by
case when purchase_amount between 0 and 10 then '$0-$10' when
purchase_amount between 10 and 20 then '$10-$20' ... end
add more frequencies as you need.
There might be a better way, but at least you'll get started :)
HTH,
Lars-Erik
[quoted text, click to view] "Kevin" wrote:
> Dear reader,
>
> I have a list of CUSTOMER_ID with PURCHASE_AMOUNT.
>
> With these information, I like to show on a bar chart the frequency of
> PURCHASE_AMOUNT (i.e. how many people spend $2, how many people spend $4,
> etc)
>
> At the same time, I like to quantize PURCHASE_AMOUNT to $0-$10, $10-$20,
> $20-$30,....(so I dont get an overly cluttered bar chart)
>
> I appreciate your time and patience in advance.
>
> Thank you.
Hi Eric
Thanks for that.. I did just that before my post to get myself started.
Wondering if there's any functionality to quantize the data like how the OLAP
cube can (you can discretize or quantize floating values there)
Cheer,
Kevin
[quoted text, click to view] "Lars-Erik" wrote:
> Hi Kevin!
>
> Maybe you can make another dataset where you "turn the query around"?
> Like
> select case when purchase_amount between 0 and 10 then '$0-$10' when
> purchase_amount between 10 and 20 then '$10-$20' ... end as frequency,
> count(distinct customer_id) as customers from orders group by
> case when purchase_amount between 0 and 10 then '$0-$10' when
> purchase_amount between 10 and 20 then '$10-$20' ... end
>
> add more frequencies as you need.
>
> There might be a better way, but at least you'll get started :)
>
> HTH,
> Lars-Erik
>
>
> "Kevin" wrote:
>
> > Dear reader,
> >
> > I have a list of CUSTOMER_ID with PURCHASE_AMOUNT.
> >
> > With these information, I like to show on a bar chart the frequency of
> > PURCHASE_AMOUNT (i.e. how many people spend $2, how many people spend $4,
> > etc)
> >
> > At the same time, I like to quantize PURCHASE_AMOUNT to $0-$10, $10-$20,
> > $20-$30,....(so I dont get an overly cluttered bar chart)
> >
> > I appreciate your time and patience in advance.
> >
> > Thank you.
Cool :)
I don't know any functionality for quantizing. I'd recommend building a
small cube then. ;)
--
Lars-Erik
[quoted text, click to view] "Kevin" wrote:
>
> Hi Eric
>
> Thanks for that.. I did just that before my post to get myself started.
> Wondering if there's any functionality to quantize the data like how the OLAP
> cube can (you can discretize or quantize floating values there)
>
> Cheer,
> Kevin
>
> "Lars-Erik" wrote:
>
> > Hi Kevin!
> >
> > Maybe you can make another dataset where you "turn the query around"?
> > Like
> > select case when purchase_amount between 0 and 10 then '$0-$10' when
> > purchase_amount between 10 and 20 then '$10-$20' ... end as frequency,
> > count(distinct customer_id) as customers from orders group by
> > case when purchase_amount between 0 and 10 then '$0-$10' when
> > purchase_amount between 10 and 20 then '$10-$20' ... end
> >
> > add more frequencies as you need.
> >
> > There might be a better way, but at least you'll get started :)
> >
> > HTH,
> > Lars-Erik
> >
> >
> > "Kevin" wrote:
> >
> > > Dear reader,
> > >
> > > I have a list of CUSTOMER_ID with PURCHASE_AMOUNT.
> > >
> > > With these information, I like to show on a bar chart the frequency of
> > > PURCHASE_AMOUNT (i.e. how many people spend $2, how many people spend $4,
> > > etc)
> > >
> > > At the same time, I like to quantize PURCHASE_AMOUNT to $0-$10, $10-$20,
> > > $20-$30,....(so I dont get an overly cluttered bar chart)
> > >
> > > I appreciate your time and patience in advance.
> > >
> > > Thank you.
Don't see what you're looking for? Try a search.