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? |