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

Calculated member using role-playing dimensions and LinkMember() rolls up incorrectly when attributes added as row groups

$
0
0

SQL DATABASE:  I have dbo.FACTORDERQUANTITY and dbo.DIMDATE in my SQL database.  I have 2 dates in dbo.FACTORDERQUANTITY as foreign keys to dbo.DIMDATE:  OpenDate and ClosedDate. 

SSAS: ORDERQUANTITY is the measure group and DATE is the dimension.  OPENDATE and CLOSEDDATE are role-playing dimensions of DATE with foreign keys being OpenDate and ClosedDate.   The DATE dimension also uses OpenDate as its foreign key.

I use DATE as the filter ([Date].[Y-M-D]), and I get all open orders based on the following calculated measure which gives me all orders where OPENDATE <= DATE and CLOSEDDATE >= DATE.  This gives me all open orders AS OF a specific date where the order has been opened and not closed:

(Sum(Crossjoin((NULL : LinkMember([Date].[Y-M-D],[Order Open Date].[Y-M-D])), (LinkMember([Date].[Y-M-D],[Order Closed Date].[Y-M-D]) : NULL), Root([Date])), [Measures].[Order Quantity]))

This works beautifully until i try to drag an attribute (say model#) on as a row group.  I only get the model#s of orders opened ON THE EXACT FILTER DATE.  The quantities are correct for those models (quantites for whole date range) but i need ALL models with rolled up quantites for the whole date range, not just models of order opened on the exact filter date.


Does anybody have any ideas?





Viewing all articles
Browse latest Browse all 2472

Latest Images

Trending Articles



Latest Images

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