dbTalk Databases Forums  

hi Any suggestions? most urgent!!

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


Discuss hi Any suggestions? most urgent!! in the microsoft.public.sqlserver.olap forum.



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

Default hi Any suggestions? most urgent!! - 04-16-2004 , 03:24 AM






Frequency Report

last3months 3 months 3 months

number of sales only once 2-4 times 5-9 times

Customers(names) 900 300 75

The abv output from sales cube,cust,time dim table ,sales
measure...so how to gt using mdx??any body??

Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: hi Any suggestions? most urgent!! - 04-16-2004 , 08:31 AM






Using Foodmart 2000, the following should do what you want

WIT
SET LASTMONTH AS '{[Time].[1997].[Q4].[12]}
MEMBER TIME.LASTTHREEMONTHS AS 'AGGREGATE(LASTMONTH.ITEM(0) : LASTMONTH.ITEM(0).LAG(2))', SOLVE_ORDER=1
MEMBER MEASURES.ONCE AS 'COUNT(FILTER(DESCENDANTS(CUSTOMERS.CURRENTMEMBER, CUSTOMERS.[NAME]), MEASURES.[SALES COUNT]=1))', SOLVE_ORDER=
MEMBER MEASURES.TWOTOFOUR AS 'COUNT(FILTER(DESCENDANTS(CUSTOMERS.CURRENTMEMBER, CUSTOMERS.[NAME]), MEASURES.[SALES COUNT]>=2 AND MEASURES.[SALES COUNT]<=4))', SOLVE_ORDER=
MEMBER MEASURES.FIVETONINE AS 'COUNT(FILTER(DESCENDANTS(CUSTOMERS.CURRENTMEMBER, CUSTOMERS.[NAME]), MEASURES.[SALES COUNT]>=5 AND MEASURES.[SALES COUNT]<=9))', SOLVE_ORDER=
SELECT CROSSJOIN({TIME.LASTTHREEMONTHS},{MEASURES.ONCE, MEASURES.TWOTOFOUR, MEASURES.FIVETONINE}) ON 0
{[Customers].[All Customers]} ON
FROM SALE

What the calculated measures in this example do is find the number of customers who have a Sales Count measure value of 1, 2-4 and 5-9 respectively. What I haven't done is include any logic about how to define 'last three months' (it's hard-coded here), because there are a number of different ways you could define it

HTH

Chri

----- reve wrote: ----

Frequency Report

last3months 3 months 3 month

number of sales only once 2-4 times 5-9 time

Customers(names) 900 300 7

The abv output from sales cube,cust,time dim table ,sales
measure...so how to gt using mdx??any body?


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.