Level(0) Function in MDX Queries

Hi All,
SELECT
ON AXIS(0),
     [Year].Levels(0).Members
} DIMENSION PROPERTIES [LEVEL_NUMBER],[MEMBER_NAME]
ON AXIS(1)
FROM 'A_LvVFPT'.'Incstmt';
by using the above script i was getting Months for Jan, Feb.... Dec. Even though i changed the Qtr1 in the place of Year, i am getting same result.
Please suggest anyone how to change the script to get result like,
if i give Qtr1, it should display only Jan, fed and march.
if i give Year, it should display Qtr1, Qtr2, Qtr3 and Qtr4. i tried many instances but not got this result.
Thanks in advance
CGR.

instead of using levels(0) you should be using children for whay you want. I would also add currentmember
so [Q1].currentmember.children

Similar Messages

  • How to tune the MDX queries to avoid memory pressure? Please Help!

    I tried to run the following mdx queries, but kept running into Memory pressure issue.  Could someone give me some suggestions to avoid the issue?
    Thanks a lot
    Executing the query ...
    Server: The operation has been cancelled due to memory pressure.
    Execution complete
    ======================Query 1=============================
    SELECT NON EMPTY { [Measures].[Net Purchased CPP] } ON COLUMNS, 
     NON EMPTY {  ([STATION].[Station Name].[Station Name].ALLMEMBERS 
     * [DAYPART].[Daypart Code].[Daypart Code].ALLMEMBERS 
     * [DEMOGRAPHIC].[Demo].[Demo].ALLMEMBERS ) }  ON ROWS
     FROM [SPOT]
     WHERE  ([ESTIMATE].[Estimate Number].&[3881] )
    ==================Query 2================================     
       SELECT NON EMPTY { [Measures].[Net Purchased CPP] } ON COLUMNS, 
     NON EMPTY {  ([STATION].[Station Name].[Station Name].MEMBERS 
     * [DAYPART].[Daypart Code].[Daypart Code].MEMBERS 
     * [DEMOGRAPHIC].[Demo].[Demo].MEMBERS ) }  ON ROWS
     FROM [SPOT]
     WHERE  ([ESTIMATE].[Estimate Number].&[3881] )
     =====================Query 3============================   
    SELECT NON EMPTY { [Measures].[Net Purchased CPP] } ON COLUMNS, 
     NON EMPTY { ([ESTIMATE].[Estimate Number].[Estimate Number].ALLMEMBERS 
     * [STATION].[Station Name].[Station Name].ALLMEMBERS 
     * [DAYPART].[Daypart Code].[Daypart Code].ALLMEMBERS 
     * [DEMOGRAPHIC].[Demo].[Demo].ALLMEMBERS ) } 
     ON ROWS FROM ( SELECT ( { [ESTIMATE].[Estimate Number].&[3881] } ) ON COLUMNS FROM [SPOT])

    Hi BI_Eric,
    The error occurs on the following scenario.
    You run a Multidimensional Expressions (MDX) query that contains a Data Analysis Expressions (DAX) measure in Microsoft SQL Server 2008 R2 Analysis Services (SSAS 2008 R2).
    The DAX measure has an expression that contains many levels of nested binary operators.
    Applying SQL Server 2008 R2 Service Pack 1 will fix the problem, please refer to the link below.
    http://support.microsoft.com/kb/2675230
    Besides, enough to seriously impair performance.you used CrossJoin function to join multiple dimensions which might cause the performance issue. If you crossjoin medium sized or large sized sets (e.g., sets that contain more than 100 items each), you can
    end up with a result set that contains many thousands of items enough to seriously impair performance.http://social.msdn.microsoft.com/Forums/sqlserver/en-US/337aea24-09ff-4354-b67d-8a90f67a13df/memory-pressure-error?forum=sqlanalysisservices
    Regards,
    Charlie Liao
    TechNet Community Support

  • Use variables in ParallePeriod function in MDX

    Hello, I am using PARALLELPERIOD () function in MDX. the syntax is
    PARALLELPERIOD([Date].[Calendar Hierarchy].[Year],1,[Date].[Calendar Hierarchy].[Date].&[20131201]). My question is can i use two variables in this? like PARALLELPERIOD( @Level,1,@Member). I know we can do PARALLELPERIOD([Date].[Calendar Hierarchy].[Year],1,@Member).
    With this two variables, i can use same query for calendar hierarchy and week hierarchy etc. Please let me know your thoughts. A work around solution is also fine.
    or can I derive @level from @member on the fly? something like PARALLELPERIOD( @Member.level,1,@Member)
    thanks in advance.
    prajwal kumar potula

    You can use variables like that client side.  That may be a .NET function that generates MDX, or SSRS does the same thing.
    Regarding whether you can derive @Level from @Member, yes you can.  Once you have substituted @Member in the query, you can use the .Level function, so it would look like this - after substitution:
    PARALLELPERIOD( [Date].[Calendar Hierarchy].[Date].&[20131201].Level,
    1,
    [Date].[Calendar Hierarchy].[Date].&[20131201]
    Christian Wade
    http://christianwade.wordpress.com/
    Please mark correct responses as answers!

  • Converting MDX queries to OBIEE 11g

    How can I convert MDX queries to OBIEE queries. Im migrating Hyperion/Brio reports to OBIEE 11g reports.

    You can always plug in your cubes as datasources into OBIEE and then create the analyses using Answers.
    A direct MDX-to-"OBIEE" path only exist if you copy your MDX queries and paste them into a direct database request which uses a conncetion pool pointing towards your cube. That said...you will miss out on a lot of vanilla functionality if you do this.
    Cheers,
    C.

  • How to use SQL functions in the queries

    hey guys i wanna know how to use SQL functions in the queries is it possible or not .

    Hi,
    Wat exactly that set values are?
    those from sql query?
    How to use count():
    The COUNT() function returns the number of rows that matches a specified criteria.
    SQL COUNT(column_name) Syntax
    The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
    SELECT COUNT(column_name) FROM table_name
    SQL COUNT(*) Syntax
    The COUNT(*) function returns the number of records in a table:
    SELECT COUNT(*) FROM table_name
    SQL COUNT(DISTINCT column_name) Syntax
    The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
    SELECT COUNT(DISTINCT column_name) FROM table_name
    The IN function helps reduce the need to use multiple OR conditions.
    The syntax for the IN function is:
    SELECT columns
    FROM tables
    WHERE column1 in (value1, value2, .... value_n);

  • Perfromance problem when using MDX queries in Crystal

    Dear All,
    I am using Crystal reports together with an MDX query from the BI system. When I run the report in the Web then it takes 60 seconds to get results. When I use this query through MDX into a crystal report the query runs very long and in most cases ends up with the message :
    Database connection error: 'No more storage space available for extending an internal table"
    It looks like there is something going on with the definition of the query on the database when using the MDX drivers. Is There a way to solve this ?
    I hear rumours that upgrading to EHP 1 Stack 3 solves performance problems arround MDX queries, but I cannot find prove anywhere. Without proof or an official statement I cannot advise the Customer.
    Please Help,
    Marcel

    Hi Ingo,
    This feature I did not use yet ;-).
    The MDX looks like :
    SELECT {[Measures].[4B78DNZSKX3JQCWJKSS9S421C]} ON COLUMNS,  NON EMPTY CROSSJOIN(EXCEPT([Z0TERR2__Z0SALEM].MEMBERS, {[Z0TERR2__Z0SALEM].[All]}), CROSSJOIN(EXCEPT([Z0CUST].MEMBERS, {[Z0CUST].[All]}), CROSSJOIN(EXCEPT([0DOC_NUMBER].MEMBERS, {[0DOC_NUMBER].[All]}), CROSSJOIN(EXCEPT([Z0TERR2].MEMBERS, {[Z0TERR2].[All]}), CROSSJOIN(EXCEPT([Z0ORDITEM__Z0CNVMAN].MEMBERS, {[Z0ORDITEM__Z0CNVMAN].[All]}), CROSSJOIN(EXCEPT([Z0CICL__Z0IMLG18].MEMBERS, {[Z0CICL__Z0IMLG18].[All]}), CROSSJOIN(EXCEPT([Z0DUMOVEN__Z0MOVDECR].MEMBERS, {[Z0DUMOVEN__Z0MOVDECR].[All]}), CROSSJOIN(EXCEPT([Z0BUSTRW].MEMBERS, {[Z0BUSTRW].[All]}), CROSSJOIN(EXCEPT([Z0BUSTSTW].MEMBERS, {[Z0BUSTSTW].[All]}), EXCEPT([Z0IBUSTRW].MEMBERS, {[Z0IBUSTRW].[All]})))))))))) DIMENSION PROPERTIES [Z0CUST].[20CITY], [Z0CUST].[2Z0CUST], [0DOC_NUMBER].[2Z0SALCRON] ON ROWS FROM [Z0SD_M04/Z0SD_M04_Q0021] SAP VARIABLES [0P_COAR] INCLUDING [0CO_AREA].[3100], [0P_COCD] INCLUDING [0COMP_CODE].[3110], [0GMFROM] INCLUDING [0FISCPER].[Y42009002], [0GMTO] INCLUDING [0FISCPER].[Y42009002], [!V000005] INCLUDING [Z0REJECFP].[Y42009002], [!V000006] INCLUDING [Z0REJECFP].[Y42009002], [ZP_CSDAT] INCLUDING [0CALDAY].[20090311]
    Running the query in MDXTEST transaction with Flattening gives data in 10 minutes.
    Running the query in multidimensional mode gives the same result.
    How to proceed ??
    Kind regards
    Marcel

  • Prior function in MDX

    HI,
    I am converting an BSO to ASO so need to change the Member furmula in MDX. I need to to change the following Prior function to MDX:
    @PRIOR( "Measure1" -> "EOPTIME" -> "DCAP001", 12, @LEVMBRS ("DLOS014", 0))
    my doubts are:
    1. How to use cross dimension in Prior function as comma (,) but it will take as an argument in function and even i cann't use braces also.
    2. in MDX we can't use range in lag function. so how to use range in lag function in MDX or any other approach?
    Thanks in advance.
    Regards,
    Abhishek

    to do the prior, you would use the lag function. It looks like you are lagging back 12 periods so you would have to add the periods dimension into the touple.
    To get the members you would use a tuple which would be something like ( [Measure1],[EOPTIME],[DCAP001],[Periods].currentmember.lag(12))
    Put that inside a case statment like Case When ISleaf([DLOS014].currentmember) then

  • Mdx-queries: how to optimize their processing?

    hi there. I have a problem with mdx-queries processing. For now mdx-queries are processed as follows:
    if I refer a dimension in an mdx-query the OLAP processor while creating a cube downloads into internal memory the whole SID-table and then the whole P- and Q- tables for the corresponding charachteristic are being downloaded as well. And it doesn't take in account any filters used in a query on this stage, i.e. the whole axis is downloaded.
    Does anyone know if there is a possibility to optimize the mdx-queries processing in  SAP BW? How to make it take in account filters on the stage of downloading master data for the cube?
    We use the SAP BW 3.5 version.

    hi there. I have a problem with mdx-queries processing. For now mdx-queries are processed as follows:
    if I refer a dimension in an mdx-query the OLAP processor while creating a cube downloads into internal memory the whole SID-table and then the whole P- and Q- tables for the corresponding charachteristic are being downloaded as well. And it doesn't take in account any filters used in a query on this stage, i.e. the whole axis is downloaded.
    Does anyone know if there is a possibility to optimize the mdx-queries processing in  SAP BW? How to make it take in account filters on the stage of downloading master data for the cube?
    We use the SAP BW 3.5 version.

  • TDMS Low level file functions and Saving Front Panel image

    Am using TDMS low level file functions to save while also plotting data in my data acquisition programme.  However, I also want to programmatically be saving the front panel image on every run of my data acquisition.  I have coded all other aspects, except the behavior of functionality of saving the front panel image on every successive runs of the application.  Unfortunately, I just have no idea on how to code this aspect on LabVIEW, and all effort to search for example codes on so far have not been successful.
    I would appreciate any useful hints or steps from anyone for me to follow, in order to accomplish this behavior, and that is being able to programmatically save my front panel images while using TDMS low level file functions in my File IO system of my application.
    Thanks in advance.

    Tebefia wrote:
    Am using TDMS low level file functions to save while also plotting data in my data acquisition programme.  However, I also want to programmatically be saving the front panel image on every run of my data acquisition.  I have coded all other aspects, except the behavior of functionality of saving the front panel image on every successive runs of the application.  Unfortunately, I just have no idea on how to code this aspect on LabVIEW, and all effort to search for example codes on so far have not been successful.
    I would appreciate any useful hints or steps from anyone for me to follow, in order to accomplish this behavior, and that is being able to programmatically save my front panel images while using TDMS low level file functions in my File IO system of my application.
    Thanks in advance.
    Did you see this link?
    CLA, LabVIEW Versions 2010-2013

  • MDX queries : BW statistics are inconsistents

    Hello,
    We are implementing BO on top of SAP BW 3.5.
    We had some major performance issues , and now we're tryning to investigate in detail.
    The queries were first launched on BO only, and afeterwards on SAP BW, using the transaction MDXTEST, we measured a similar amount of time.
    Now now want to have a closer look at the distribution of the time spent. (DB%,Frontend%;Network%, etc...)
    The problem is that when we have a look at transaction ST03 in BW analysis, the statistics of MDX
    queries are inconsistents :
    I've join a concrete example :
    The left column is a BO statistic executed on SAP using MDXTEST,
    The right column is a traditional BEX query.
    When I do the addition of the different time %(percent total) the results is 100 % for the Bex query ...and 44% for the MDX query.
    I know that many fixes for MDX have been delivered on BI.7, but what about 3.5, I searched the sap notes but I couldn't find any note descrybing this symptom, nor any fix for our BW release.
    Do you know how I should interpret thoses results, in other worlds, where ar the missing percentages in MDX queries ?
    thank you in advance for your help.
    Regards.
    InfoCube Name                                         Cube C      Cube C
    Name of Query                                Query A(BO)        Query B(BEX)
    Number of Navigation Steps                        1     1
    Total Runtime (s)                                       534,9     39,8
    Total Runtime / Navigation Step (s)     534,9     39,8
    Median of Total Runtime (s)                      534,9     39,8
    Initialization Time (s)                                        0,2     0,4
    Initialization Time / Total Runtime (%)     0,04     1,01
    Ø Initialization Time (s)                     0,2     0,4
    OLAP Runtime (s)                                    0,9     2,1
    OLAP Time / Total Runtime (%)                  0,17     5,28
    OLAP Runtime / Navigation Step (s)     0,9     2,1
    Database Runtime (s)                                  197,0     22,4
    Database Runtime / Total Runtime (%)     36,83     56,28
    DB Runtime per Navigation Step (s)     197,0     22,4
    Frontend Runtime (s)                                    33,9     4,8
    Frontend Runtime / Total Runtime (%)     6,34     12,06
    Frontend Time per Navigation Step (s)     33,9     4,8
    Master Data Runtime (s)                    5,6     10,1
    Master Data Time / Total Runtime (%)     1,05     25,38
    Ø Master Data Time per Navigation Step     5,6     10,1
    Number of records selected                  18620     899
    Number of Transferred Records                10037     629
    Ratio of Selected to Transferred Records     1,9     1,4
    Database Time per Selected Record (ms)     10,6     24,9
    Number of Cells                                       162060     7295
    Cells per Transferred Records                   16,1     11,6
    Number Formatted                                     0     72
    Ratio of Formattings to Number of Cells     0,0     0,0
    percent Total     :                     44,43% for MDX              and  100,01% as expected for BEX
    time                                             237,8     40,2
    Edited by: Raoul Shiro on Feb 5, 2009 6:54 PM

    Hi Raoul,
    in regards to the BW statistics values I would suggest you open a OSS case.
    in regards to the performance improvements - correct they are done for BI7 and the XI 3.1 release.
    Ingo

  • Reg MDX queries in BI

    Hi All,
    If anyone know about MDX queries in BI please share some documentation.
    We are using OBIEE as front end for BI for reporting purpose which uses MDX quries from SAP bi
    Thanks

    Hi Arun
    Thanks for ur reply
    I tried using MDXTEST
    But i need some more doumentation about that.

  • Tunning ASO cube for metada mdx queries

    Hi,
    I have some metadata mdx queries, for this kind of queries is there any special tunning which would be applied?

    Syntax has changed for ASO member formulas and semicolons are no longer used. Why would you want to use the semicolon? With the new syntax it is not necessary.

  • MDX Queries , Webservices in SAP BI7.0

    In BI we have a Query and that query is being used by .NET Application. Now we need to do some changes in the query. While i made a change in the query in Q-Sys that change is not reflecting in the .NET Application[Q-Sys]. From the .NET Person i received some MDX Queries which are using for retrieving the data from the query. I used the TCODE : MDXTEST while im going to give that MDX Query and run it is showing the data, but that data is not similar to the query o/p(changed query), it is showing the data (as of before modifying the query).
    Any one please help me out, regarding this MDX Queries, What is the WebService part in BW,
    When  XMLA, SOAP, WSDL ... come into picture as of BW side.

    check these
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e8/2cd937651f1a13e10000009b38f8cf/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/c8/e92637c2cbf357e10000009b38f936/content.htm

  • MDX queries that used to work on SSAS 2008 not working on 2012

    Hello,
    We are still using the old PerformancePoint planning server which is writing MDX queries against a SSAS 2012 at this time.   What used to work against SSAS 2008 is now having issues.   I captured a profile and the part of the query which
    generates the error is this error:  The '' calculated member cannot be created because a calculated member with the same name already exists.    What has changed in SSAS 2012 where this would not work anymore?;  is there anyway to
    make the 2012 environment work with this code again?.   The code generation is out of my control so I need to find a way to enable backwards compatibility with the way the tool generates the MDX statements.
    WITH
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
      MEMBER [Account].[Staffing_V3].[] AS ""
    Thanks,
    Matt

    Hi Matt,
    According to your description, the MDX query which has the duplicate calculated member name can run success with out any problems in SSAS 2008, however the same query cannot work in SSAS2012 with the error below, right?
    The '' calculated member cannot be created because a calculated member with the same name already exists.
    I have tested it on my local environment, and the result turn out that this is the default change by Microsoft from SSAS 2008 R2 version. And I am afraid there is no any workarounds run this similar query in SSAS 2012. So in your scenario, you
    need to remove the duplicate members in the query.
    Thank you for your understanding.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Level Down / Level up functionality

    HI SDN,
    I am using Level down functionality for formulas in a query. When I execute the query, by default all the levels are being displayed.  How to make only top nodes to be displayed in the initial view so that user can expand required sub nodes.
    Thanks
    Full Points will be assigned.

    Boy!!!
    Go to the query edit mode.
    right click on the hierarchy field and property.
    there you will see Level of display, change the default level and when you run the query by default you will see that level, if users want more, they can expand it.
    thanks.
    Wond

Maybe you are looking for

  • ITunes wont Install at all

    I have run the .exe for itunes 6.0.1 and every time after it completes the program is automatically deleted from the computer. Any suggestions?

  • Problem with Text Messaging on new iphone with non iphone users

    Ever since I set up imessage forwarding to be able to send/receive text messages on both my mac book pro and iphone people with non iphones are not getting my text messages from either device.  In my settings - messages - text message forwarding it o

  • Creating movement in space

    Hi there, Im working on some [stereo, not surround] cinematic projects at the moment, and I want to create a sense of movement through the audio field. Obviously, I'll be using pan for left-right movements, but I wondered if any of you had any tips f

  • Regarding Number of MAIN Windows in SAP Script.

    Hi, SAP Script allows to place a maximum of 99 MAIN Windows. Is it possible to have different content in different MAIN Windows i.e., if i have 2 MAIN Windows in SAP Script with numbers 00 and 01 can i have different contents in these two windows. If

  • Is iMessage available on all Mac operating systems?

    Is iMessage available on my system?  If so, how do I get to it?