MDX queries SSAS results-show to client via Adomd.net

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.