After the SSAS multidimensional model is built, in addition to the Excel client directly linked to the SSAS source drag pivot Analysis use, you can also tell the result set to be displayed through the MDX statement query, embedded in the program, run the program to run out the complete report. :
MDX for OLAP datasets is like Transact-SQL for Microsoft SQL Server relational databases. In SQL MdxQuery Query window, the results of SSAS are displayed in our custom applications, similar to the traditional ADO-linked SQL database engine.
For example, the following MDX query code:
withMEMBER[Target] as [Measures].[USD REV target-vw ST subregion TGT]/ +MEMBER[QTD] as [Measures].[ST AMT USD]/ +MEMBER[hitrate] asINFO[Target]=NULL OR [Target]=0,NULL,[QTD]/[Target]) MEMBER[So_target] as [Measures].[USD REV TARGET]/ +MEMBER[SO_QTD] as [Measures].[So AMT USD]/ +MEMBER[so_hitrate] asINFO[So_target]=NULL OR [So_target]=0,NULL,[SO_QTD]/[So_target]) SELECTCROSSJOIN ([Overviewallbrand-bu].[BU CODE], {[Target],[QTD],[hitrate],[So_target],[SO_QTD],[so_hitrate]}) onCOLUMNS, CROSSJOIN ({[overviewallbrand-region].[Region EN],[overviewallbrand-region].[Region EN]. Children}, {[Overviewallbrand-channel].[CHANNEL TYPE]. Children,[Overviewallbrand-channel].[CHANNEL TYPE]}) onROWS from [Overviewallbrand] where([overviewallbrand-region].[Area CN].&[ China])
View Code
Principle:
1, the client and SSAS communication, in fact, delivery is xml/a instructions. This instruction can be initiated through a standard web Request (encapsulated as a SOAP package) or through the client API.
2. SQL Server comes with a client api,microsoft.analysisservices.adomdclient.dll. This assembly, typically in C:\Program Files (x86) \microsoft.net \adomd.net\100\microsoft.analysisservices.adomdclient.dll the path below. So first you need to refer to this DLL first in the project program.
The way to use ADOMD is similar to the standard ADO, and also requires an object such as connection and command, except that its query syntax is so-called MDX (Multidimensional Expression), and that the result returned is not a planar two-dimensional structure, There may be multiple axes (up to 128 axes), so the parsing is more complicated.
MDX queries SSAS results-show to client via Adomd.net