MDX query for derived measures

Hi,
I have a requirement to show data like the below output. Could anyone suggest how do I proceed. For the below report StoreID and Date would be my parameters to the below report.
StoreID
    date
Department
Total Sales For Dept A
Units Sold for Dept A
Total Sales
For All Dept
11002
   21/05/2014
      A
100
5
1000
11004
   22/05/2014
A
150
3
1000
Thanks in advance.

Hi ,
I hope I understand your request, Do you want to have a special calculation for a specific case ?
If so, you can add a member to your query to be evaluated on the members you want :
With member standard as ([Measures].[Sales],[Dept].[Dept].CurrentMember,[Date].[Date].CurrentMember ,,,)
member NonStandard as ([Measures].[Sales],[Dept].[Dept].[All],[Date].[Date].CurrentMember ,,,)
Regards, David .

Similar Messages

  • Missing field for MDX query for All Members

    Hello,
    I'm using MDX query with SSRS for report and I ran into this issue:
    Query 1:
    select non empty ([Product].[Category].allmembers*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
    ([Measures].[Internet Sales Amount]) on 0
    from [Adventure Works]
    go
    Query 2
    select non empty ([Product].[Category].[All]*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
    ([Measures].[Internet Sales Amount]) on 0
    from [Adventure Works]
    In case I run query 2 in SSDT (query designer), it doesn't return first column whereas if I run above two queries in SSMS, I get similar columns/fields.
    How it can be resolved in SSRS to return all columns for query 1 and 2.
    Thanks,
    P
    mark it as answer if it answered your question :)

    Hello,
    I'm using MDX query with SSRS for report and I ran into this issue:
    Query 1:
    select non empty ([Product].[Category].allmembers*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
    ([Measures].[Internet Sales Amount]) on 0
    from [Adventure Works]
    go
    Query 2
    select non empty ([Product].[Category].[All]*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
    ([Measures].[Internet Sales Amount]) on 0
    from [Adventure Works]
    In case I run query 2 in SSDT (query designer), it doesn't return first column whereas if I run above two queries in SSMS, I get similar columns/fields.
    How it can be resolved in SSRS to return all columns for query 1 and 2.
    Thanks,
    P

  • How to build MDX query for two periods of time?

    I have the following MDX:
    SELECT NON EMPTY
    [Measures].[Returns],
    [Measures].[Returns]
    ON COLUMNS,
    NON EMPTY
    ([Employees].[Company].[Company].ALLMEMBERS )
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM
    SELECT
    STRTOSET("[Exec Date].[Hierarchy].[Month Num].&[2014]&[1]", CONSTRAINED)
    ) ON COLUMNS FROM [cbSales]
    WHERE
    IIF(
    STRTOSET("[Exec Date].[Hierarchy].[Month Num].&[2014]&[1]", CONSTRAINED).Count = 1,
    STRTOSET("[Exec Date].[Hierarchy].[Month Num].&[2014]&[1]", CONSTRAINED),
    [Exec Date].[Hierarchy].currentmember
    Both columns shows returned data for month 2014/01
    I want to have data for the next month (2014/02) in the second column.
    How can I change the query to achieve my goal.

    Hi,
    To achieve this you need to create another measure with the help of ParallelPeriod function. Check the following example;
    WITH MEMBER [Measures].[Sales Amount Current] AS [Measures].[Sales Amount]
    MEMBER [Measures].[Sales Amount Next] AS ([Measures].[Sales Amount], PARALLELPERIOD([Date].[Calendar].[Month],-1, [Date].[Calendar].CURRENTMEMBER)), format_string = "Currency"
    MEMBER [Measures].[Current Month] AS [Date].[Calendar].CURRENTMEMBER.Member_Caption
    MEMBER [Measures].[Next Month] AS PARALLELPERIOD([Date].[Calendar].[Month],-1, [Date].[Calendar].CURRENTMEMBER).Member_Caption
    SELECT {[Measures].[Current Month], [Measures].[Sales Amount Current], [Measures].[Next Month], [Measures].[Sales Amount Next]} ON COLUMNS,
    {[Product].[Category].[Category].MEMBERS} ON ROWS
    FROM [Adventure Works]
    WHERE [Date].[Calendar].[Month].&[2007]&[10]
    For ParallelPeriod specify -1 for "Numeric Expression" to navigate forward of the date hierarchy.
    Best regards,
    Chandima
    Thanks, nice answer

  • MDX query for parent-child combination display

    Hi guys..
    I am really new to the Essbase technology.
    Could you please help me out with this one:
    is it possible to extract the data(for example the metadata of a outline)..eg:-
    The outline structure is as follows :
    A1
    A11
    A12
    A2
    A21
    A22
    I want a MDX query to display it as :
    A1 A11
    A1 A12
    A2 A21
    A2 A22
    I have tried various ways but couldnt come up with a query for this.
    Thanks in advance for all your help.

    Unfortunately MDX cannot do this. If you think about what you are asking for, you are essentially saying that you want to see members of the same dimension on different axis. Multi-dimensional queries can't do that (think about trying to do it with addin).
    A further limiation is that MDX is not robust enough to allow you to work the results into a single axis using a concatenation function because while there is a string-to-member function, there is no member-to-string function and concat requires a string as input.
    Other approaches would require MDX to support joins or subqueries, which it does not.
    As others have mentioned, to do what you want to do, you need outline extractor or something like that.
    *Fun fact - if you have OBIEE 11g, it can do reporting in Essbase with hierarchy members in hierarchy format or column format, which will give you the results you need.  That alone is good reason to start using OBIEE.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • MDX query for to get the data from two cubes

    Hi
    Can you tell me how to create MDX query to get the values from two cubes.  (One hierarchy from first cube and one hierarchy from second cube)
    Can you give me one example.
    Regards,
    Madhu.
    Sudhan

    Hi Sudhan,
    According to your description, you want to retrieve data from two different cubes, right? The short answer is yes. To query multiple cubes from a single MDX statement use the LOOKUPCUBE function (you can't specify multiple cubes in your FROM statement).
    The LOOKUPCUBE function will only work on cubes that utilize the same source database as the cube on which the MDX statement is running. For the detail information about it, please refer to the link below to see the blog.
    Retrieving Data From Multiple Cubes in an MDX Query Using the Lookupcube Function
    Regards,
    Charlie Liao
    TechNet Community Support

  • MDX Query for Top 10 in SSAS Project

    Hi Guys,
    Please I need an MDX query that will help me calculate Top 10 inside the SSAS project.
    Your help will be greatly appreciated.
    Thanks
    me

    Hi,
    I know nothing about PowerView and PerformancePoint Server but I played with Excel and I am able to use the named set I created. Here are the steps which I followed.
    1 - Create the named set. Remember... this name set appears inside the dimension which you use as the first parameter inside TOPCOUNT function.  
    2 - Deploy the cube and perform a process full.
    3 - Navigate to PowerPivot ribbon and click on PowerPivot Window.
    4 - Choose From Database > From Analysis Services or PowerPivot. Specify the necessary SSAS server credentials and connect to the Cube which you are interested.
    When it comes to the MDX query design window you construct your MDX code in SSMS and copy that code. You also can use the design mode as well. In this case you have to toggle the "design mode" option and enter to manual mode which you can type
    your MDX code. Here is a screenshot of that.
    5 - Validate your query and click Finish. Once the data is in you can create your power pivot report. Here is an example.
    I hope this helps to troubleshoot your issue.
    Best regards...
    Chandima Lakmal Fonseka

  • MDX Query for Average customer first sale amount for each year

    Hello,
    I new to MDX, and I am looking to build a query that would get all the first sale amount for the customes and average that.  The intent is to use find an average each year.   I am looking to use this against the adventure works database.   
    I am not sure exatcly how to start this .  Any help is much appreciated.
    J

    Hi,
    I'll do it in several stages.
    let's first define an ordered set of date/sale to one customer over all periods:
    SELECT
    {[Measures].[Internet Sales Amount]} ON 0
    NonEmpty
    [Date].[Calendar].[Date]
    [Customer].[Customer].&[15561]
    ,[Measures].[Internet Sales Amount]
    ,[Customer].[Customter].&[15561]
    ) ON 1
    FROM [Adventure Works];
    we retain the first line of the result set  with item(0):
    SELECT
    {[Measures].[Internet Sales Amount]} ON 0
    NonEmpty
    [Date].[Calendar].[Date]
    [Customer].[Customer].&[15561]
    ,[Measures].[Internet Sales Amount]
    ,[Customer].[Customer].&[15561]
    ).Item(0) ON 1
    FROM [Adventure Works];
    next, for each year we define a measure that will retain the first sale for each customer
    (I  limit the customer set to the first 2000)
    WITH
    MEMBER [Measures].[Mymeasure 2006] AS
    NonEmpty
    Exists
    [Date].[Calendar].[Date].MEMBERS
    ,[Date].[Calendar].[Calendar Year].&[2006]
    [Customer].[Customer].CurrentMember
    ,[Measures].[Internet Sales Amount]
    ,[Customer].[Customer].CurrentMember
    ).Item(0)
    ,[Measures].[Internet Sales Amount]
    MEMBER [Measures].[Mymeasure 2007] AS
    NonEmpty
    Exists
    [Date].[Calendar].[Date].MEMBERS
    ,[Date].[Calendar].[Calendar Year].&[2007]
    [Customer].[Customer].CurrentMember
    ,[Measures].[Internet Sales Amount]
    ,[Customer].[Customer].CurrentMember
    ).Item(0)
    ,[Measures].[Internet Sales Amount]
    SELECT
    [Measures].[Mymeasure 2006]
    ,[Measures].[Mymeasure 2007]
    } ON 0
    ,NON EMPTY
    Head
    [Customer].[Customer].[Customer]
    ,2000
    ) ON 1
    FROM [Adventure Works];
    We then take the average for each year:
    WITH
    MEMBER [Measures].[AVG cust first sale 2006] AS
    Avg
    Head
    [Customer].[Customer].[Customer]
    ,2000
    NonEmpty
    Exists
    [Date].[Calendar].[Date].MEMBERS
    ,[Date].[Calendar].[Calendar Year].&[2006]
    [Customer].[Customer].CurrentMember
    ,[Measures].[Internet Sales Amount]
    ,[Customer].[Customer].CurrentMember
    ).Item(0)
    ,[Measures].[Internet Sales Amount]
    MEMBER [Measures].[AVG cust first sale 2007] AS
    Avg
    Head
    [Customer].[Customer].[Customer]
    ,2000
    NonEmpty
    Exists
    [Date].[Calendar].[Date].MEMBERS
    ,[Date].[Calendar].[Calendar Year].&[2007]
    [Customer].[Customer].CurrentMember
    ,[Measures].[Internet Sales Amount]
    ,[Customer].[Customer].CurrentMember
    ).Item(0)
    ,[Measures].[Internet Sales Amount]
    SELECT
    [Measures].[AVG cust first sale 2006]
    ,[Measures].[AVG cust first sale 2007]
    } ON 0
    FROM [Adventure Works];
    Philip,

  • MDX query Help - filtering Measures based on values in a dimension.

    Hi,
    I want to get values of a aggregate measure filtered by value available in Dimension attribute.
    Details:
    We have a Measure called "Average Compliance" which provides an average value over certain dimensions. Now I have some target values available for different attributes.
    Fact Table (there are bunch of other columns in the fact table)
    Id
    TargetId
    InstanceId
    LocationId
    Compliance
    1
    1
    1
    1
    0
    2
    1
    1
    2
    1
    3
    2
    1
    1
    1
    4
    2
    2
    1
    0
    5
    2
    1
    1
    1
    6
    2
    1
    1
    1
    Dimension
    TargetId
    Target Average Compliance
    1
    90
    2
    70
    3
    92
    4
    40
    Now I want to get a query where I can get the "Average Compliance" which is higher then the target average compliance.
    Is this achievable?
    Thanks in advance.

    HI,
    I did give this a try. (replacing the date dimensions.)
    WITH MEMBERMEASURES.mycalc AS
    [Dim Measure].[Target].
    CURRENTMEMBER.MEMBER_KEY
    SELECT
    {[Measures].[Average Compliance],MEASURES.mycalc}
    ON0
    FILTER([Dim Measure].[Target].[Target]
    ,([Measures].[Average Compliance] * 100) <
    --80
    CINT([Dim Measure].[Target].
    CURRENTMEMBER.MEMBER_KEY)
    )*[Dim Measure].[Measure Uri].[Measure Uri]
    ON1
    I am still seeing values for average compliance which are more than the target (I even tried setting the value to be hardcoded to 80 and I still see average compliance of 100
    Thanks

  • Need an MDX query for Date range

    Hi there,
    My requirement is to filter sales from 1st of month to until holiday of the month. I am able to use to ":" range function for filtering, but I am not able to filter on holiday date. Becuase both filter and exists are giving set results, I need
    member expression to use range function. Please let me know ASAP.
    Thanks,
    ATRSAMS

    Hi ATRSAMS ,
    You can get the first member of the month with the OpeningPeriod function, and item(#) to have a specific member from a set .
    So if you want first member from your set : filter(.....).ITEM(0)
    Regards, David .

  • Constructing Calculated Measures in MDX for different measures using same columns in a fact table

    Hello,
    i have a fact table with 2 columns corresponding to dimensions Dim1, Dim2. In the same table i have 4 other columns Value_Type(int), INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string). There are a number of measures which are identified by Value_Type and
    depending on their nature could be written in one of the 3 columns (INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string)) Let's say Measure1 with Measure_Type=1 is age, 2 is account balance and 3 is Name for clarity. There could be other measure types that
    use these 3 same columns for data. So the sample fact table looks like this
    Dim1 Dim2 Measure_Type INT_VALUE FLOAT_VALUE TEXT_VALUE
    10 10 1 25
    10 10 2 2000,34
    10 10 3 John
    10 20 1 28
    10 20 2 3490,23
    10 20 3 Frank
    My task is to write an MDX query for each Dim1, Dim2 combination which returns all 3 measures in the same row. The idea is to construct a calculated member for each Measure that returns value from the right field. For example for Measure1 we take INT_VALUE
    with measure_type=1. The problem is i don't know how to construct MDX query for these calculated members. Can you please help me?
    So my final goal is to write an MDX query that returns all measures in one row for each set of Dim1, Dim2
    SELECT [Measure1], [Measure2], [Measure3] ON COLUMNS,
    NON EMPTY [Dim1].[Dim1].[Dim1].Members*[Dim2].[Dim2].[Dim2].Members ON ROWS
    FROM [Cube]
    Dim1 Dim2 Measure1 Measure2 Measure3
    10 10 25 2000,34 John
    10 20 28 3490,23 Frank

    Hi Kosmipt,
    I would combine the "INT_VALUE", "FLOAT_VALUE" and "TEXT_VALUE" columns into one with STRING data type for the fact table. And there should be one dimension to store the Measure_Type informations. Then in cube, you can write MDX scope for every one of
    "Measure_Type" dimension members. For example,
    scope(
                [Measures].[M]
        [DimMType].[MType].&[1]= CINT([Measures].[M]);                                                                                                                             
    end scope;
    Once the cube is built by the above way, you can write MDX like something like the following to achieve your purpose.
    WITH member [Measures].[Measure1] AS ([DimMType].[MType].&[1],[Measures].[M])
             member [Measures].[Measure2] AS ([DimMType].[MType].&[2],[Measures].[M])
             member [Measures].[Measure3] AS ([DimMType].[MType].&[3],[Measures].[M])
    thanks,
    Jerry

  • SSRS report with cube – MDX query how to get an extra row with value '0'.

    Hello everyone,
    I'm unable to write the MDX query to get '0' value as first row in output. Following is my MDX query:
    WITH MEMBER [Measures].[Dummy] AS   '0'
    SELECT NON EMPTY Union( {[Measures].[Amount] },{[Measures].[Dummy]}) ON COLUMNS,
    NON EMPTY  { ([Customer].[Customer Nbr].[Customer Nbr].ALLMEMBERS * [Fiscal].[Year].[Year].ALLMEMBERS ) }
    having  [Measures].[Amount] > 5000
    ON ROWS FROM [cube]
    With above query, the output returns the value '0' as a separate column.
    I would like to get it in form of first row for [Measures].[Amount]. Like,
    Amount
    0
    500
    200
    100
    What needs to be changed to achieve the above result? I'm planning to use the above value in line chart to start the line from 0th value as described in following URL. (Note: The below URL is using SQL query and not MDX expressions.)
    http://spinerain.blogspot.in/2013/09/ssrs-line-chart-create-stacked-line-and.html
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    The round brackets in your expression are forcing an implicit crossjoin between the 3 lines. I would do the following which creates a set of the DummyYear plus the real year members and then crossjoin that with the customer set.
    WITH MEMBER [Fiscal].[Year].DummyYear AS   '0'
    SELECT NON EMPTY {[Measures].[Amount]} ON COLUMNS,
     NON EMPTY  {[Fiscal].[Year].DummyYear,
         [Fiscal].[Year].[Year].MEMBERS} *
                [Customer].[Customer Nbr].[Customer Nbr].MEMBERS
     having  [Measures].[Amount] > 5000
    ON ROWS FROM [cube]
    http://darren.gosbell.com - please mark correct answers

  • Date parameters using MDX query

    Hello experts,
    Not sure if this question falls under SSAS or SSRS but I'm writing it here for now and hopefully get the answer.
    I'm using SSAS cube to develop a report using SSRS and this is the first time I'm doing it. I want to filter records based on date range and did some research online. My report contains two datasets:
    1. dsMain dataset -> it contains all the field which I want to use in the report and added a parameter thru query designed with following settings:
    Dimension : Dates
    Hierachary : Date
    Operator : Range (Inclusive)
    Parameters : checked
    it created two parameters called FromDatesDate and toDatesDate
    2. I created another dataset called dsDate and wrote a custom query (found at following link) and changed FromDatesDate and ToDatesDate using this date dataset
    https://jsimonbi.wordpress.com/2011/03/22/using-a-date-parameter-in-ssrs-with-mdx/
    Query for dsDate
    WITH
    MEMBER DateValue
    AS
       [Dates].[Date].CurrentMember.UniqueName
    MEMBER DateLabel
    AS
       [Dates].[Date].CurrentMember.Name
    SELECT
        [Measures].[DateValue],
        [Measures].[DateLabel]
    } ON 0,
         [Dates].[Date].[Date]
    } ON 1
    FROM [myCube]
    Here is the value returned by dsDate dataset (above query)
                            DateValue                          DateLabel
    06/04/1980 [Dates].[Date].&[29375]
    06/04/1980
    06/05/1980 [Dates].[Date].&[29376]
    06/05/1980
    06/06/1980 [Dates].[Date].&[29377]
    06/06/1980
    06/07/1980 [Dates].[Date].&[29378]
    06/07/1980
    06/08/1980 [Dates].[Date].&[29379]
    06/08/1980
    06/09/1980 [Dates].[Date].&[29380]
    06/09/1980
    06/10/1980 [Dates].[Date].&[29381]
    06/10/1980
    06/11/1980 [Dates].[Date].&[29382]
    06/11/1980
    06/12/1980 [Dates].[Date].&[29383]
    06/12/1980
    06/13/1980 [Dates].[Date].&[29384]
    06/13/1980
    Here is what I changed in FromDatesDate and ToDatesDate parmeter:
    Under Available Values tab:
    Dataset : dsDate
    Value Field : DateValue
    Label Field : DateLabel
    Here are my questions:
    1. I want to use date/time parameter so that user doesn't have to scroll thru whole date dimension.
    2. I changed the FromDatesDate and ToDatesDate to date/time parameter, removed the values from Available values tab and made the following changes on Parmaeters expression under dsMain dataset
    =”[Dates].[Date].&[” + Format(CDate(Parameters!FromDatesDate.Value),”MM/dd/yyyy”)
    + “T00:00:00]”
    =”[Dates].[Date].&[” + Format(CDate(Parameters!ToDatesDate.Value),”MM/dd/yyyy”)
    + “T00:00:00]”
    Now when I run the report I get following error:
    Query (1, 55) The restrictions imposed by the CONSTRAINED flag in the STRTOMEMBER function are violated.
    I think the reason is by changing parameter to date/time, now I cannot get "DateValue" which is required for the query.
    1. What is the best way to work with date parameters?
    Hope it is all clear and look forward to hear from experts.
    Thanks,
    P
    mark it as answer if it answered your question :)

    Hi Parry2k,
    In Analysis Services, a member can be referenced by either its member name or by its member key. The member key is used by the dimension to specifically identify a given member. The ampersand (&) character is used in MDX to differentiate
    a member key from a member name. In this scenario, the datetime is member name, not the member key. So you should not add "&".
    Reference:
    Member Names and Keys
    Simon Hou
    TechNet Community Support

  • ASO MDX query in outline??????

    Trying to write a MDX query for the Account member
    Hierarchy:
    Account
    A001
    A002
    A003
    A008
    Scenario
    AG00
    AG01
    AG06
    AG08
    AG09
    Organization
    ETCE
    E023
    E024
    E070
    I need to caluculate for the Account AG08 the value should be derived from AG07 and for the same account AG08 for the Organization member "E070" the value should be same as AG09 ( i.e AG09 = AG08 )
    I writen below query at the level "0" retrival query is good but when i use the Top level query "ETCE" parent level the value in "E070" is eliminating . Query writen below
    NONEMPTYMEMBER [A001],[A007]
    CASE
    WHEN (IS([Organization].CurrentMember, [E070])) THEN
    ([A009])
    WHEN (IS([Scenario].CurrentMember, [AG00])) THEN
    (([A007] * -1)/100)
    WHEN (IS([Scenario].CurrentMember, [AG01])) THEN
    (([A007] * -1)/100)
    WHEN (IS([Scenario].CurrentMember, [AG02])) THEN
    (([A007] * -3)/100)
    WHEN (IS([Scenario].CurrentMember, [AG03])) THEN
    (([A007] * -10)/100)
    WHEN (IS([Scenario].CurrentMember, [AG04])) THEN
    (([A007] * -20)/100)
    WHEN (IS([Scenario].CurrentMember, [AG05])) THEN
    (([A007] * -80)/100)
    WHEN (IS([Scenario].CurrentMember, [AG06])) THEN
    ([A007])
    ELSE
    Missing
    END
    At Bottom level "0" results are coming as expected but Its not working at the top level Organization ETCE level Please help ????
    Thanks
    Venu
    Edited by: user13351102 on Oct 28, 2011 5:19 PM
    Edited by: user13351102 on Oct 28, 2011 6:31 PM

    Guru's any help on this ASO Member formula query ??

  • Converting MDX query into SQL Server 2008

    We have MDX query based OLAP CUbes.
    To reduce MDX based dependenies, we have to convert MDX based cube to sql server 2008 based queries.
    For this I need expert advise to convert below query to sql server 2008 based query :
    CREATE MEMBER CURRENTCUBE.Measures.[Ack Lost]
                        AS 'Sum(PeriodsToDate([Time].[Year], [Time].CurrentMember ), [Measures].[Lost])',
                        FORMAT_STRING = "#,#",
                        VISIBLE = 1;

    Hi Sachin,
    According to your description, you need to convert the MDX query to T-SQL query, right?
    Your MDX query is calculated measure that return the total value from the first sibling and ending with the given member. In T-SQL query we can use the query as Yogisha provided to achieve the same requirement. Now you need to a tool to convert all the MDX
    related SSAS cube queries to MS SQL Server 2008 based queries.
    Although MDX has some similarities with T-SQL these languages are in many ways different. Beginning to learn and comprehend SQL Server Analysis Services (SSAS) MDX queries can be difficult after one has spent years writing queries in T-SQL. Currently, there
    is no such a tool to convert a MDX query to T-SQL query since the structure difference between MDX and T-SQL. So you need to convert them manually, please refer to the links below to see the details.
    http://www.mssqltips.com/sqlservertip/2916/comparison-of-queries-written-in-tsql-and-sql-server-mdx/
    https://sqlmate.wordpress.com/2013/11/12/t-sql-vs-mdx-2/
    http://technet.microsoft.com/en-us/library/aa216779(v=sql.80).aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Sets in Mdx Query

    HI,
    More Sets will give the performance or less sets will give the more performance.Could you please help me.
    with
    member [Measures].[Uniquenames]
    as [Date].[Calendar Year].currentmember.uniquename
    set s1
    as
    filter(([Date].[Calendar Year].children),
    ([Date].[Calendar Year].currentmember.name='CY 2005'
    or [Date].[Calendar Year].currentmember.name='CY
    2006'
    or [Date].[Calendar Year].currentmember.name='CY
    2007'
    or [Date].[Calendar Year].currentmember.name='CY
    2008'
    or [Date].[Calendar Year].currentmember.name='CY
    2010'))
    select {[Measures].[Uniquenames]}
    on columns,
    (s1)
    on rows
    from [Adventure Works]
    indu

    thank you for reply.
    my project  UI is .net application,backend mdx queryes.
    In my project,i have import functionality.
    In IMPORT functionality,they are importing names,through excel,we are getting names,then we have to generate mdx query.
    so first i am generateing keys using with names,then i am passing keys to general mdx.
    In first query, they are importing 4000 names.so  i created 8 sets,each set contain 500 names in mdx query for retriving keys,but it takes 27 secs.
    with
    member [Measures].[Uniquenames]
    as [Date].[Calendar Year].currentmember.uniquename
    set s1
    as
    filter(([Date].[Calendar Year].children),
    ([Date].[Calendar Year].currentmember.name='CY
    2005'
    or [Date].[Calendar Year].currentmember.name='CY
    2006'
    or [Date].[Calendar Year].currentmember.name='CY
    2007'
    or [Date].[Calendar Year].currentmember.name='CY
    2008'
    or [Date].[Calendar Year].currentmember.name='CY
    2010' …. 500))
    set s2
    as
    filter(([Date].[Calendar Year].children),
    ([Date].[Calendar Year].currentmember.name='CY
    2005'
    or [Date].[Calendar Year].currentmember.name='CY
    2006'
    or [Date].[Calendar Year].currentmember.name='CY
    2007'
    or [Date].[Calendar Year].currentmember.name='CY
    2008'
    or [Date].[Calendar Year].currentmember.name='CY
    2010' …. 500))
    select {[Measures].[Uniquenames]}
    on
    columns,
    union({s1},{s2})
    on
    rows
    from [Adventure Works]
    I want to reduce time.
    could you please help me suitable mdx query as per requirement .
    indu

Maybe you are looking for

  • PDF Documents can not be printed

    Recently, after a new Adobe Reader updated, I can not print PDF document any more. (Word documents all can be printed.) Every time when I clicked "print", the error messag "Before you can perform print-related task such as page setup or printing a do

  • Update phone number keychain

    Hi there, I have iPhone 4s with ios8 and macbook pro retina with Yosemite. Lately I wanted to start using keychain with iCloud, but the number where keychain sends the verification code its still my old number, and even changing my number in settings

  • Jump to an item field in a transaciton like VA01

    Hi All, There're lots of fields in the the item table of transaction like VA01. It is difficult to input value to a specific field. For example, if I need to input the payment term for a sales order item, I have to drag the scroll bar to the far righ

  • Creating DW templates - Repeating Optional Region?

    Hello Again: I know that it isn't always the best to pose abstract questions on forums, but I am wondering if anyone can tell if/how one can create an optional region within a repeating region of a DW template? The specific conundrum I seem to face t

  • Can only use phone in speaker phone mode

    I can only use the phone in speaker phone mode. Neither party can hear the phone in regular mode. Any ideas