"New" Distinct Customer Count -
04-09-2006
, 11:17 PM
Greetings,
We have cube with a Dimension (three levels) :
Level 1 - Branch
level 2 - Products
Level 3 - Accounts
All the Accounts have Member Properties associated with them such as
"Account Opening Date".
The Cube has measures such as Outstanding Principal Amount /
Outstanding
Interest Amount / Loan Disbursed Amount.
We use the Member properties (Account Opening Date) to Filter the
Account
based on the User Inputs and we display the data grouped on Product (
the
Data is grouped at SRS 2k)
We also need to display the Count of Total Customers & New Customers
added
within the Date Range (which is user specified) product wise.
Here is the Query we have written to get the Total Customer Count Till
Date :-
WITH
MEMBER
[MEASURES].[CalcCount] AS
'COUNT(CROSSJOIN({[MEASURES].[RelativeCalcCount]},
DESCENDANTS([Customers].CURRENTMEMBER,
[Customers].[Customer ID])), EXCLUDEEMPTY)'
MEMBER
[MEASURES].[RelativeCalcCount] as ' CoalesceEmpty(
([MEASURES].[Customers Count], [Transaction Dates].CurrentMember),
([MEASURES].[RelativeCalcCount], [Transaction
Dates].currentmember.prevmember))'
SELECT
{ [MEASURES].[CalcCount]} ON 0,
-- [Customers].CHILDREN ON 1,
[ProductsAccounts].[Product IDBR].Members on 1
FROM LoansAndSavings
WHere
([Transaction Dates].[All Transaction Dates].[2004].[Quarter
4].[October].[1])
Now our problem is getting the Count of New Customers , how do we
introduce
the From Date to get the New Customers.
Thanks,
Charu Gupta |