dbTalk Databases Forums  

Histograms MDX

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Histograms MDX in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
LD
 
Posts: n/a

Default Histograms MDX - 10-08-2003 , 09:00 PM






In analyzing data, sales and the like, I found Histograms to be of great
value. The x-axis would be the buckets, in the Foodmart example, it would be
Sales Units>> 0-10, 11-20, 21-30 etc. in the y-axis, the respective
frequencies of customers in those bins >> 10, 30, 50 etc.

Right Now, I use a stored procedure which takes the @interval_start,
@interval, uses a temp table to hold the counts and outputs to a table which
I then link to a chart component. Was wondering whether there is an easier
way to do that using MDX. And how would I approach that?

As per Tom(Chester)' s suggestion(which I think is very practical), in the
Foodmart 2000 db, the row(s) would be the intervals(start at 0, add 10) and
the column should contain the customer counts for each bin. Wouldn't mind
hardcoding a bit (just for the sake of MDX!).

LD



Reply With Quote
  #2  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: Histograms MDX - 10-09-2003 , 02:26 AM






"LD" <ldhal (AT) hotmail (DOT) com> wrote

Quote:
In analyzing data, sales and the like, I found Histograms to be of great
value. The x-axis would be the buckets, in the Foodmart example, it would
be
Sales Units>> 0-10, 11-20, 21-30 etc. in the y-axis, the respective
frequencies of customers in those bins >> 10, 30, 50 etc.
with
set CustomerNames AS 'descendants(customers.currentmember,
[Customers].[Name])'
member measures.[0 - 20] as 'count(filter(CustomerNames, [Store Sales] <
20))'
member measures.[20 - 40] as 'count(filter(CustomerNames, [Store Sales] >=
20 AND [Store Sales] < 40))'
member measures.[40 - 60] as 'count(filter(CustomerNames, [Store Sales] >=
40 AND [Store Sales] < 60))'
member measures.[60 - 80] as 'count(filter(CustomerNames, [Store Sales] >=
60 AND [Store Sales] < 80))'
member measures.[80 - ...] as 'count(filter(CustomerNames, [Store Sales] >=
80))'
select {[0 - 20], [20 - 40], [40 - 60], [60 - 80], [80 - ...]} on 0
from sales

HTH,
Mosha

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================




Reply With Quote
  #3  
Old   
Lal Dhal
 
Posts: n/a

Default Re: Histograms MDX - 10-09-2003 , 09:46 AM



Thanks a lot. This is exactly what I needed.
LD
"Mosha Pasumansky [MS]" <moshap (AT) microsoft (DOT) com> wrote

Quote:
"LD" <ldhal (AT) hotmail (DOT) com> wrote in message
news:e0fRtkgjDHA.684 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
In analyzing data, sales and the like, I found Histograms to be of great
value. The x-axis would be the buckets, in the Foodmart example, it
would
be
Sales Units>> 0-10, 11-20, 21-30 etc. in the y-axis, the respective
frequencies of customers in those bins >> 10, 30, 50 etc.

with
set CustomerNames AS 'descendants(customers.currentmember,
[Customers].[Name])'
member measures.[0 - 20] as 'count(filter(CustomerNames, [Store Sales]
20))'
member measures.[20 - 40] as 'count(filter(CustomerNames, [Store Sales] >=
20 AND [Store Sales] < 40))'
member measures.[40 - 60] as 'count(filter(CustomerNames, [Store Sales] >=
40 AND [Store Sales] < 60))'
member measures.[60 - 80] as 'count(filter(CustomerNames, [Store Sales] >=
60 AND [Store Sales] < 80))'
member measures.[80 - ...] as 'count(filter(CustomerNames, [Store Sales]
=
80))'
select {[0 - 20], [20 - 40], [40 - 60], [60 - 80], [80 - ...]} on 0
from sales

HTH,
Mosha

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.