MDX Procedure Based on .NET

本文介绍了如何使用MDX(多维表达式)与.NET相结合来解决多维数据分析中的复杂问题。通过部署包含特定.NET过程的自定义分析组件到分析服务器上,可以实现对两数值进行减法运算的功能。此外,还探讨了静态方法与实例方法在服务器调用过程中的区别。

MDX script in SSAS provides strong functions for multidimensional data analysis, however many problems are hard to solve with MDX actually. Because not all the problems can be cope with MDX script. In other words, these problems will be solved by coding way easily. MDX procedure is supported by all the .NET languages.

namespace CustomAnalysisAssembly 

    
public class SPDemo 
    { 
        
public static double SalesDifference(double firstVal, double secondVal) 
        {
            
return secondVal – firstVal; 
        } 
    }
}

 


The .NET MDX procedure can be used when a assembly that contain the specific procedure is deployed into the analysis server or multidimensional dataset. It is a demo .NET MDX procedure implemented by C#. Its function is to compute the subtraction of two numbers. The method is static. However it is not the only choice. Non-static method also can be used. But the server will create the same object for many times for using instance method. Obviously, it leads to the waste of system resources. In contrast, server will invoke the static method directly instead of creating instance object time and time again. So it is recommended to carry out the procedure by static method.

SELECT MEMBER [Date].[Diff] AS 
CustomAnalysisAssembly.SPDemo.SalesDifference(   
//Invoke .NET Method
    
[Date].[YMD].[Year].&[2009]
    
[Date].[YMD].[Year].&[2008] 

SELECT [Date].[Diff] ON COLUMNS 
FROM [AWCube] 
WHERE [Measures].[Internet Sales Amount] 

 

转载于:https://www.cnblogs.com/SmartBizSoft/archive/2009/06/11/1501013.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值