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

Calculated member for all open orders as of a given date (point in time)?

$
0
0

Hello.

I have an Order Fact with a Quantity Measure and 2 date dimentions (order open date and order closed date):

[Measures].[Quantity]

[OpenDate].[YMD]

[ClosedDate].[YMD]

I need to calculate the total quantity of open orders AS OF a given date (which would be a filter on open date).  Open Orders would be defined as quantities where the "date filter" date falls in between the Open Date and and Closed Date (OpenDate<= DateFilter AND ClosedDate > (or >=) dateFilter).  Orders can stay open from the beginning of time which means that I have to keep all orders in the Order Fact which is about 7 million rows.

I think that I would sum the quantity for all orders with open date <= date filter something like this:

Sum(PeriodsToDate([OpenDate].[YMD].[(All)]), [Measures].[Quantity])

But I have not idea how I would add the condition where ClosedDate > datefilter...(I believe this would be the same is remove rows where ClosedDate <= Datefilter)

I would appreciate any input.

Thanks, Renee.




Viewing all articles
Browse latest Browse all 2472

Trending Articles



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