Insert SSAS Cube records measure and dimensions to relational table

Hi,
I need to retrieve one measure with a couple of its related dimensions from an ssas cube and have it stored in SQL table. How could this be done?
In order to read data from cube and insert into SQL relational table
this thread says to use openquery but states that it will only work if there are measures on the columns
and no dimensions on columns.
Is there a way to query a measure with a couple of its related dimensions
in MDX using openquery? Or any other way to query the cube to get these into SQL?
(Or should I better get the data from the base SQL tables which the cube is built from?)
Thanks for advising
Namnami

Hi Namnami,
Sure Darren Gosbell thread will help you, you can try below things.
You can get more info on
this link
Basically to write SQL+MDX combined we have to create link server from where we want data to combine with SQL. To create link server you need to have Admin access to the SQL Server.
IF IS_SRVROLEMEMBER ('sysadmin') = 1
print 'Current user''s login is a member of the sysadmin role'
ELSE IF IS_SRVROLEMEMBER ('sysadmin') = 0
print 'Current user''s login is NOT a member of the sysadmin role'
ELSE IF IS_SRVROLEMEMBER ('sysadmin') IS NULL
print 'ERROR: The server role specified is not valid.'
Above Query returns the whether you have admin admittance to the server or not to create Link Server.
More Details on Hybrid Query-
USE
AdventureWorksDW2008R2
GO
EXEC
sp_addlinkedserver
@server='Test',
@srvproduct='',
@provider='MSOLAP',
@datasrc='localhost',
@catalog='Adventure Works DW 2008R2'
Declare @MDXExpression as Varchar(MAX)
Select @MDXExpression =
SELECT
NON EMPTY
[Measures].[Sales Amount]
,[Measures].[Standard Product Cost]
,[Measures].[Tax Amount]
,[Measures].[Total Product Cost]
} ON 0,
NON EMPTY
[Sales Channel].[Sales Channel].[Sales Channel]
} ON 1
FROM
[Adventure Works]
Exec ('SELECT * INTO ##TestTemp FROM OpenQuery(TestTest1,''' + @MDXExpression + ''')')
SELECT
CONVERT(varchar,t."[Sales Channel].[Sales Channel].[Sales Channel].[MEMBER_CAPTION]") AS [Date],
(CONVERT(nvarchar,t."[Measures].[Sales Amount]")) AS [Sales Amount],
(CONVERT(nvarchar,t."[Measures].[Standard Product Cost]")) AS [Standard Product Cost],
(CONVERT(nvarchar,t."[Measures].[Tax Amount]")) AS [Tax Amount],
(CONVERT(nvarchar,t."[Measures].[Total Product Cost]")) AS [Total Product Cost]
from
##TestTemp t
--DRop Table ##TestTemp
Query Execution-
1-     
So above query first creates liked server with named as 'Test'.
2-     
After that MDX query executed on linked server where we have kept the MDX query in MDXExpression variable.
3-     
Using OpenQuery function data gets dump in to ##TestTemp table.
4-     
Finally we get the data from ##TestTemp table.
Thanks,
Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.
My Blog
Follow @SuhasKudekar

Similar Messages

  • Concatenate measure and dimension field shows not enough memory available

    Hello, I need to concatenate a measure and dimension, for dummy test I did  Cstr([Measures].[MeasureName]) + "dummy string, (unit of measure required here)"
    but this generate an error, please see image for required measure. 
    Executing the query ...
    Server: The operation has been cancelled because there is not enough memory available for the application. If using a 32-bit version of the product, consider upgrading to the 64-bit version or increasing the amount of memory available on the machine.
    Execution complete
    MDX Query:
    WITH 
    MEMBER [Measures].[Cant Fact Umv2] 
    AS Cstr([Measures].[Cant Fact Umv]) + "dummy string, (unit of measure required here)"
     SELECT 
     NON EMPTY { [Measures].[Cant Fact Umv], [Measures].[Cant Fact Umv2] } ON COLUMNS, 
     NON EMPTY { 
    ([Categoria Materiales].[Categoria Material].[Categoria Material].ALLMEMBERS * 
    [Productos].[Producto].[Producto].ALLMEMBERS * 
    [Ventas Analisis].[UM Venta].[UM Venta].ALLMEMBERS ) } 
     DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM  [Ventas Analisis 2] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

    Why cant this be done at the presentation? why should you do it in MDX?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • What Measure and Dimension are provided by SAP BW?

    Hi all
    Can everybody please let me know, what are all measure and dimension are providedby SAP BW in MM module. I want to design the star schema for OLAP report.
    Thank a lot

    MM module has many business content avaiable,
    under Supply Chain Performance Management you can see
    Inventory Management, Logistic Execution, Procurement:
    http://help.sap.com/saphelp_nw04/helpdata/en/29/79eb3cad744026e10000000a11405a/frameset.htm
    good work.
    Sergio

  • How create a record type and a pl/sql table of that record type in database

    Hi
    I want to create a record type and then I want to create a PL/SQL table in the oracle 9i database.
    I have done it in PL/SQL block.
    But when I am trying to do it in database it is throwing me some error.
    Could you please tell me how can I do that?
    Regards

    user576726 wrote:
    Hi
    I want to create a record type and then I want to create a PL/SQL table in the oracle 9i database.
    I have done it in PL/SQL block.
    But when I am trying to do it in database it is throwing me some error.
    Could you please tell me how can I do that?
    RegardsRECORD type is supported only in PL/SQL for SQL you need to use OBJECT type.

  • SSRS report with tabular model – MDX query how to get the sum and count of measure and dimension respectively.

    Hello everyone,
    I am using the following MDX query on one of my SSRS report.
    SELECT NON EMPTY { [Measures].[Days Outstanding], [Measures].[Amt] } ON COLUMNS,
    NON EMPTY { ([Customer].[Customer].[Customer Key].ALLMEMBERS) }
    HAVING [Measures].[ Days Outstanding] > 60
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM ( SELECT ( STRTOSET(@Location, CONSTRAINED)) ON COLUMNS
    FROM ( SELECT ( {[Date].[Fiscal Period].&[2014-06]}) ON COLUMNS
    FROM [Model]))
    Over here, the data is being filtered always for current month and for a location that is being selected by user from a report selection parameter.
    I would like to get the count of total no. of customers and sum of the amount measure.
    When I am using them in calculated members it gives incorrect values. It considers all records (ignores the sub-select statements) instead of only the records of current month and selected location.
    I also tried with EXISTING keyword in calculated members but there is not difference in output. Finally, I manage the same at SSRS level.
    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Any help would be much appreciated.
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Hi Ankit,
    We can use SUM function and COUNT function to sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension. Here is a sample query for you reference.
    WITH MEMBER [measures].[SumValue] AS
    SUM([Customer].[Customer].ALLMEMBERS,[Measures].[Internet Sales Amount])
    MEMBER [measures].[CountValue] AS
    COUNT([Customer].[Customer].ALLMEMBERS)
    MEMBER [Measures].[DimensionName] AS [Customer].NAME
    SELECT {[Measures].[DimensionName],[measures].[SumValue],[measures].[CountValue]} ON 0
    FROM [Adventure Works]
    Besides, you ask that does it make any difference if I manage it as SSRS level and not at MDX query level. I don't thinks it will make much difference. The total time to generate a reporting server report (RDL) can be divided into 3 elements:Time to retrieve
    the data (TimeDataRetrieval);Time to process the report (TimeProcessing);Time to render the report (TimeRendering). If you manage it on MDX query level, then the TimeDataRetrieval might a little longer. If you manage it on report level, then the TimeProcessing
    or TimeRendering time might a little longer. You can test it on you report with following query: 
    SELECT Itempath, TimeStart,TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering, ByteCount, [RowCount],Source
    FROM ExecutionLog3
    WHERE itempath like '%reportname'
    Regards,
    Charlie Liao
    TechNet Community Support

  • Dynamic Measures and dimensions

    Is it possible to use dynamically both dimensions and measures in one report - I.e. to have two sets of input controls, one for dimensions and other for measures?
    Thank You

    Hi,
    yes you can have both - for quantities, for qualification
    but i'm not sure what dynamic requirements you might have between them.
    the webi application's own help files has lots of information about this.
    Regards,
    H

  • Cost centre and cost element related tables

    Hi,
    Could any help me in knowing whre the cost centre goup and cost element groups are maintained.
    Could you help in proving the link tables between Cost centre, Cost centre Group, Cost element and Cost element group.
    Regards,
    Krishna

    Hi,
    Please refer to Table SETLEAF for cost element group and cost center group. This table is based on set class and 0101 is for Cost Center Group and 0102 is for Cost Element Group.
    Cost Center Master data table is CSKS and Cost element Master data table is CSKB. To the bse of my knowledge you cannot directly join these two tables with SETLEAF table as key figure fields are not common. In case you are getting any ABAP report developed, you can ask the developer to write a code saying Controlling Area is equal to Organizational Unit as Set Subclass.
    Hope this helps.
    Regards,
    Harish

  • Purchase document and service order relation table

    Hi All,
    I am trying to enhance one datasource is there any relation we have for the purchase document and the service order?
    Could you please let  me know
    Thanks
    Srini

    EKPO and ESSR is the relation betqwwen the Purchase order and the service entry/orders.
    Regards
    Srini

  • How to get the Multiplied value between measure and a dimension base on user selection using dynamically

    Hi Experts,
    We had developed a cube with the Measures and Dimensions.
    I had a requirment as the measures should be muliplied by the currency value of different countries and get me the results.
    For Example.
    In SSRS report, the user will select "EUR" then the measures should multiply with the EUR based value for the particular month and get the result in the SSRS report. If the user select any other currency value, that should multiply with the measure
    value and get the result in SSRS report.
    How to do that in SSAS Cube.
    Thanks
    Shashi

    Hi ,
    If I understand your requirement  correctly , then you need currency Conversion.
    you can refer this links.
    http://consultingblogs.emc.com/christianwade/archive/2006/08/24/Currency-Conversion-in-Analysis-Services-2005.aspx
    http://www.ssas-info.com/analysis-services-faq/27-mdx/244-how-change-currency-symbol-based-on-selected-currency-dimension-member
    http://social.technet.microsoft.com/wiki/contents/articles/18672.currency-conversion-in-ssas-2012-multidimensional-tabular.aspx
    May I know , You Require all this using MDX and SSRS Parameter ?
    Thanks

  • How to tune performance of a cube with multiple date dimension?

    Hi, 
    I have a cube where I have a measure. Now for a turn time report I am taking the date difference of two dates and taking the average, max and min of the date difference. The graph is taking long time to load. I am using Telerik report controls. 
    Is there any way to tune up the cube performance with multiple date dimension to it? What are the key rules and beset practices for a cube to perform well? 
    Thanks, 
    Amit

    Hi amit2015,
    According to your description, you want to improve the performance of a SSAS cube with multiple date dimension. Right?
    In Analysis Services, there are many tips to improve the performance of a cube. In this scenario, I suggest you only keep one dimension, and only include the column which are required for your calculation. Please refer to "dimension design" in
    the link below:
    http://www.mssqltips.com/sqlservertip/2567/ssas--best-practices-and-performance-optimization--part-3-of-4/
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • SSRS Date parameter - current month from SSAS cube

    I have a SSAS cube with a date dimension called Posting Period and now I would like to have my report parameter using this date dimension to show the current month.
    So far I have worked out the following expression which are working(Fiscal year calendar going from May to May) for the year component - but I can't figure out how to get it to work on Quarter date part (and the month) so as you can see
    the Quarter and month is hardcoded in the below expression:
    ="[PostingPeriod].[Posting Period].[Year].&[" + CStr(Year(Today())-1) + "].&[Q4].&[10]”
    Any help would be appriciated.
    Tx

    Hi HCMJ,
    In your scenario, you use the expression
    ="[PostingPeriod].[Posting Period].[Year].&[" + CStr(Year(Today())-1) + "].&[Q4].&[10]”
    to set the default value of the parameter and then use it in the MDX query, right?
    If in this case, you can use the expression below
    ="[PostingPeriod].[Posting Period].[Year].&[2013].&[Q" & DatePart(DateInterval.Quarter,today()) & "].&[10]”
    to set the value on Quarter date part.
    And it returns:
    If I have anything misunderstood, please point it out and elaborate the meaning of "but I can't figure out how to get it to work on Quarter date part (and the month) so as you can see the Quarter and month is hardcoded
    ", so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SSAS Cube Hierarchy Default Member, not aggregatable in pivot table multi select, Urgent

    Hi All,
    I have one problem in my project ssas cube. one of the dimension hierarchy, a value has been set up as default member in calculation tab.
    The problem is:
    When i filter (select multiple) this defaulted value and other value in excel pivot, it is always showing default member value instead of selected members aggregated value. if i remove default member it is working fine. Can you please provide work around
    for this.
    Please note that, if select multiple values within that hierarchy (this time not selected default value), aggregation is working fine.
    Thanks, Rajendra

    Hi Hirmando,
    According to your description, the default member cause incorrect data when dragging a attribute that contain a default member to the FILTERS area, right?
    I can reproduce this issue on my environment, when dropping this dimension in the filter area of my pivot table and select multiple members including the default member then only data for the default member is shown. Currently, it's hard to say the root
    reason that cause this issue. In order to narrow down this issue, please apply the latest server pack and cumulative update.
    Besides, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback So that microsoft will confirm if this is a know issue.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Where there are standard template or schema for cube/dimention/measure

    Hi,
    since i should create many dimentions, cubes and measures, i want to know whether there are some standard template or schemas for them so that i can buildup some xml file and import into data warehouse.
    thanks for your help since i'm a totally newer on olap

    There are no standard templates. If you use AWM, then it is easy to create objects.
    The other "programmatic" option is use DBMS_CUBE.IMPORT_XML and then provide your own XML to create:
    (1). dimensions, attributes, hierarchies and all the mappings
    (2). cubes, stored measures and all the mappings
    (3). Calculated measures
    Create your AW and some dimensions and a cube inside it, using AWM.
    Then take the XML of the each dimension and each cube, and look at it in editor (like notepad).
    You will get some idea what XML tags are used, and then (if you like) you can create new dimensions and cubes by writing your own XML.
    Search this forum for keyword "XML", and you will see lot of postings.
    Search Terms: XML
    Category: OLAP
    Data Range: ALL
    After you get the results, then SORT BY "DATE"
    .

  • How to define join in physical layer between cube and relational table

    Hi
    I have a aggregated data in essbase cube. I want to supplement the information in the cube with data from relational source.
    I read article http://community.altiusconsulting.com/blogs/altiustechblog/archive/2008/10/24/are-essbase-and-oracle-bi-enterprise-edition-obiee-a-match-made-in-heaven.aspx which describes how to do it.
    From this article I gather that I have to define a complex join between the cube imported from essbase to my relational table in physical layer.
    But when I use Join Manager I am only able to define jooin between tables from relation source but not with the imported cube.
    In My case I am trying to join risk dimension in the cube based on risk_type_code (Gen3 member) with risk_type_code in relation table dt_risk_type.
    How can I create this join?
    Regards
    Dhwaj

    Hi
    This has worked the BI server has joined the member from the oracle database to cube. So Now for risk type id defined in the cube I can view the risk type code and risk type name from the relational db.
    But now if I want to find aggregated risk amount against a risk type id it brings back nothing. If I remove the join in the logical model then I get correct values. Is there a way by which I can combine phsical cube with relational model and still get the aggregated values in the cube?
    I have changed the column risk amount to be sum in place of aggr_external both in logical and phsical model.
    Regards,
    Dhwaj

  • Insert order by records into a view with a instead of trigger

    Hi all,
    I have this DML query:
    INSERT INTO table_view t (a,
                              b,
                              c,
                              d,
                              e)
          SELECT   a,
                   b,
                   c,
                   d,
                   e
            FROM   table_name
        ORDER BY   dtable_view is a view with an INSTEAD OF trigger and table_name is a table with my records to be inserted.
    I need the ORDER BY clause because in my trigger i call a procedure who treat each record and insert into a table, used in the view. I need to garantee these order.
    If i put an other SELECT statement outside, like this:
    INSERT INTO table_view t (a,
                              b,
                              c,
                              d,
                              e)
          SELECT   a,
                   b,
                   c,
                   d,
                   e
            FROM   table_name
        ORDER BY   dIt works. But I can put these new SELECT because these query is created automatic by Oracle Data Integrator.
    What I'm asking you is if there any solution to this problem without changing anything in the Oracle Data Integrator. Or, in other words, if there is any simple solution other than to add a new SELECT statement.
    Thanks in advance,
    Regards.

    Sorry... copy+paste error :)
    INSERT INTO table_view t (a,
                              b,
                              c,
                              d,
                              e)
        SELECT   *
          FROM   (  SELECT   a,
                             b,
                             c,
                             d,
                             e
                      FROM   table_name
                  ORDER BY   d)I need to insert him by a D column order, because my trigger needs to validate each record and insert him. I have some restrictions. For example, my records are:
    2     1     2006     M
    1     2     2007 M
    1     3     2007     S 2007
    1     2     2007     S 2007
    2     1     2009     S
    2     1     2009     S
    I want to insert the 'M' records first and then the 'S' records because the 'S' records only makes sense in target table is exists 'M' records
    Regards,
    Filipe Almeida

Maybe you are looking for

  • Error While Grouping the objects in Business Content

    Hi BW Guru, Have u any idea about the following Messages. RSA1- Business Content -> Grouping ->Only necessary Object for the INFOCUBE (0SD_C03) in business content for install it is showing message like 1. InfoObject 0PDCEOBJ is not active in the sys

  • XML Development Vs. Oracle Developer

    My question is simple: We do all of our development work using Oracle Developer and recently have begun to use the Forms Server to put our applications on the Web...I have read a little about XML, but I was wondering if anyone could lend some argueme

  • ISE Sponsor Portal Questions!!!

    Hi Team, Few questions!! Can we integrate ISE with Safenet(Token) for VPN access using Inline Posture? 2. When we create user account in Sponsor portal in ISE. By Default Where does the user gets created, In internal database of ISE  or in Active Dir

  • Coversion

    how to write a program to convert a pdf file into a msword file? can we write such a program to convert.If so please give me suggestions to write a program cheers

  • 2 Login Pages in single realm

    My question is really for Sun AM 7.1, but I am sure the answer for OpenSSO will be the same. Is it possible to have 2 different login pages within the same realm? I have a scanario where I have 2 different user types existing in the same directory, b