Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

Send full cube context to an SSAS UDF?

$
0
0

Hello,

There is a cube containing a list of orders. Each order can contain multiple products. The question we want our cube to answer is: "How many orders are there which contain both product x and y?". With a little help, I managed to implement that using many-to-many-relationships and hidden cross-referenced measure groups.

Now this pattern is to be extended to another type of cube with more orders and more products. I tried it using the above approach, but found out it is simply too much for our current hardware (and we have to live with that for the time being) - due to the several cross-referenced measure groups necessary, cube size, processing performance and query performance exploded.

There is another approach I have tried. I implemented a small DLL in c# that is able to tunnel mdx queries to our data warehouse. It is using the SQL-version of intersect. I added it to the analysis services database as an assembly, and created a custom member using the UDF from the DLL. Now there is only one problem remaining: How do I get the cube context to the UDF? I know I can send [Dimension].[Hierarchy].CurrentMember to the UDF, but I would need to do that for like 40 hierarchies. Additionally, this doesn't work for multi selects like our customers prefer to do in our main frontend Excel.

This is how it looks at the moment:

CREATE MEMBER CURRENTCUBE.[Measures].[TestPT]
 AS myClass.myFunction(MemberToStr([Product].[Product Categories].CurrentMember)), 
VISIBLE = 1  ;

Is there any option to send the full cube context? Like a big object, containing all the dimension selections the user made in his frontend?

Thanks for any help!

Edit: This is SQL Server 2008 R2.



Viewing all articles
Browse latest Browse all 14337

Trending Articles



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