Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Ignore Dimensions

$
0
0

I am trying to calculate the average number of trips per week for a customer.

I want to start by gathering the first trip date and the number of trips which I can do with the following

MEMBER firsttripdate as
Head(NonEmpty([Date Dimension].[Actual Date].[Actual Date],[Measures].[Units])).Item(0).MEMBER_name
MEMBER LoyaltyTrips as
(COUNT((NONEMPTY([Date Dimension].[Actual Date].[Actual Date],[Measures].[Units]))))

I then calculate days since first trip

MEMBER dayssincefirsttrip as
datediff("d",firsttripdate,(Format(Now(), "yyyy-MM-dd")))

Then get the average per week

MEMBER AverageTripsPerWeek AS
LoyaltyTrips/(dayssincefirsttrip/7)

This works great, until a date is selected (other dimensions as well), then the calculations work based on the date selected.

I would like to be able to just have this calculation work based solely on the customer dimension. Basically ignoring all dimensions but the customer dimension. I tried using the root(), but couldn't seem to get that to work.

Any help is appreciated.


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>