MDX Statement for TopCountin UniverseDesigner

Hi together,
I'm trying to build a TOP N function in a WebIntelligence Document. In a SAP BW Query I've created a formula variable.
For example the User enters 5 for the variable, so I want to show the TOP 5 of one keyfigure.
IN SAP BW i can use the condition in the Query to SOLVE it.
Universes in SAP BO / WebIntelligence doesn't use conditions from the query.
Can anyone help me to build a MDX-Statement in the Universe Designer to get the TOP N of a keyfigure.
Thanks a lot!
Kind regards
Lars

Hi Ingo,
thanks for your fast reply.
I found the document and I think I'm near a solution.
My current MDX statement generated from the universe is:
WITH MEMBER [Measures].[24145E65-73A0-DF11-85,88,14,60,A,C,0,0] AS
TOPCOUNT([0ME_MED_ISS].[LEVEL01].members,3,Measures].[26SDIBEB571NMBEOG191RX7OO])
SELECT  {[Measures].[26SDIBEB571NMBEOG191RX7OO],  [Measures].[24145E65-73A0-DF11-85,88,14,60,A,C,0,0],
    [Measures].[EQAO129PIC9UWXOJ2W2KRLANC] }  ON COLUMNS ,
NON EMPTY UNORDER( {[0DIVISION].DEFAULTMEMBER} )  ON ROWS
FROM [ZSDAMP004/ZSDAMP004_S004]
SAP VARIABLES [Z1PME003] INCLUDING [0DIVISION].[40] [Z1PME003] INCLUDING [0DIVISION].[22] [Z1PME003]
INCLUDING [0DIVISION].[21] [Z1PME003] INCLUDING [0DIVISION].[20] [Z1PME003]
INCLUDING [0DIVISION].[00] [Z1PEI036] INCLUDING [0PLANT].[9010] [Z1PIN030]
INCLUDING [0CALMONTH].[200906] : [0CALMONTH].[201008]
[ZFV010] INCLUDING 2
The Problem is the  Statement:
WITH MEMBER [Measures].[24145E65-73A0-DF11-85,88,14,60,A,C,0,0] AS
TOPCOUNT([0ME_MED_ISS].[LEVEL01].members,3,[Measures].[26SDIBEB571NMBEOG191RX7OO])
if I use the statement in the one above and use the transaction mdxtest in bw:
WITH MEMBER [Measures].[24145E65-73A0-DF11-85,88,14,60,A,C,0,0] AS 1 it works fine.
My declaration in the univese for the TOPCOUNT is:
<EXPRESSION>TOPCOUNT([0ME_MED_ISS].[LEVEL01],3,[Measures].[26SDIBEB571NMBEOG191RX7OO])</EXPRESSION>
The Error for the statement is: "Invalid MDX command with ,"
Thanks a lot.
Lars
Edited by: Lars Ohm on Aug 5, 2010 12:32 PM

Similar Messages

  • MDX Error for SAP Variables

    Hi All,
    We have used QAAWS for creating a dashboard in Xcelsius using Trigger cell for a selection variable in BI Query.When a different selection is maded for that variable getting the below error (In this case i have selected US for the variable)
    A database error occured. The database error text is: The MDX query SELECT { [Measures].[4FYOXRUNHMI2F3N8G0Q6GNC0I] } ON COLUMNS , NON EMPTY [0SALESORG].[LEVEL01].MEMBERS DIMENSION PROPERTIES [0SALESORG].[40SALESORG] ON ROWS FROM [ZGC0_M001/TEST_2] SAP VARIABLES [TEST_BO] INCLUDING US failed to execute with the error Unknown error. (WIS 10901)
    checked in MDXTEST giving  the query
    SELECT { [Measures].[4FYOXRUNHMI2F3N8G0Q6GNC0I] } ON COLUMNS , NON EMPTY [0SALESORG].[LEVEL01].MEMBERS DIMENSION PROPERTIES [0SALESORG].[40SALESORG] ON ROWS FROM [ZGC0_M001/TEST_2] SAP VARIABLES [TEST_BO] INCLUDING US
    It thrown an error saying the above query is invalid.
    Later i tried with the below query
    SELECT { [Measures].[4FYOXRUNHMI2F3N8G0Q6GNC0I] } ON COLUMNS , NON EMPTY [0SALESORG].[LEVEL01].MEMBERS DIMENSION PROPERTIES [0SALESORG].[40SALESORG] ON ROWS FROM [ZGC0_M001/TEST_2] SAP VARIABLES [TEST_BO] INCLUDING [0SALESORG].[US]
    Now it perfectly worked fine.
    Can any one let me know why a wrong MDX query is getting generated and how to rectify it?
    Regards,
    Pra

    Hi Ingo,
    Sorry for the late reply....
    Yes i am sending the Key values as the input for the variables.
    If you observe the 2 MDX Statements(the last line especially) .....i guess [SalesOrg] needs to get appended in the MDX Statement  for the Key values  that i input and as it is not happening it is throwing an error saying MDX error.
    Regards,
    Pra

  • How to Generate a MDX statement using a BEX query

    Hello,
    Is there any possiblity in BW to generate a MDX statement using a BEx query?
    Thanks,
    Ravi

    BW does not generate any MDX statement for Bex query.I have tried ample number of times to acheive this but failed.
    Like an Infocube the Query is also an object where in you can write MDX queries on BEx Queries.
    As it is I never found BW rendering MDX queries.But with MDX queries you can get something but how far it helps I don't know.
    RSCRM_BAPI is obsolete and it is recommended to use RSCRM_REPORT somewhere I have read ,but when I went to that transaction I never found that "MDX" button at all.
    It was converted to "OLAP Check" which gave me some warning on the key figures and that's it.
    Somehow I feel BW is not comfortable with MDX.
    Regs
    Gopi

  • "Syntax error in the MDX statement " in Process chain failure??Urgent pls

    Hi Experts,
    could any one suggest me the procedure to rectify the below problems in process chain?
    1."Syntax error in the MDX statement "
    2."Error when getting data (Error when getting data (AXI))"
    Rgds,
    BH

    In which case it'll be that Access has a different date format to MySQL, and you're trying to push the string "'25-Apr-12 10:55 PM" into Access, which it's not understanding. To get around this, you need to treat your variable as a true date/time object, rather than a formatted string.
    CFQueryParams should be used on absolutely every database platform, they'll stop your website being vulnerable to SQL Injection attacks for one, which at the moment you're wide open to. Replace your query with something like this:
    <cfquery name="input_comments" datasource="#DSN#" username="#DSNUSER#" password="#DSNPASS#">
          INSERT INTO comments(
                             commenter,
                             comment,
                             datetime,
                             post_id
                   VALUES(
                             <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.commenter#" />,
                             <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.comment#" />,
                             now(),
                             <cfqueryparam cfsqltype="cf_sql_numeric" value="#form.post_id#" /> )
    </cfquery>
    The QueryParams will handle the data types for you, and should pass values around more safely and with fewer issues. Assuming you just want to store the current date and time you don't even need to get ColdFusion involved, as databases have their own functions for this. I believe Access' version is simply NOW(), so I've put that in your query.
    Give the above a go.

  • T-code: RSCRM_REPORT to see MDX statement

    Hi All,
    When you go to T-code: RSCRM_BAPI or RSCRM_REPORT, and when you select a query and in the menu bar you will see "display MDX statement."
    For some reason I cannot see any statement when I do that. Can anyboby tell me how to solve this or is there a way to find MDX Statements ( I know about MDXTEST, RSFLAT, RSCRMMDX)
    Thanks
    Kalyan

    Hello Experts,
    Please share your thoughts!!!
    Kalyan

  • Filter in MDX Statement

    I have a very basic MDX statement which contains a FILTER statement:
    WITH
    SET [Selected Discipline] AS STRTOSET(@Disciplines, CONSTRAINED)
    SET [Selected Department] AS STRTOSET(@Departments, CONSTRAINED)
    SET [Selected Departments] AS IIF(@Disciplines = @Departments,
    FILTER(
    DESCENDANTS([Selected Discipline], [Employee].[DISC - DEPT - EMP].[Department], AFTER),
    NOT INSTR([Employee].[DISC - DEPT - EMP].CurrentMember.UNIQUE_NAME, "Freelance")),
    DESCENDANTS([Selected Department], [Employee].[DISC - DEPT - EMP].[Department], AFTER))
    SET [TTM] AS { LastPeriods(12, StrToMember(@SelectedMonth, CONSTRAINED)) }
    SELECT
    [Measures].[Employee Hours],
    [Measures].[Employee Hours %]
    } ON COLUMNS,
    NON EMPTY CROSSJOIN(
    [Selected Departments],
    [Employee].[Employee Bill Rate].[Employee Bill Rate].ALLMEMBERS,
    [Employee].[Employee Level].[Employee Level].ALLMEMBERS,
    [TTM]) ,
    FILTER ([Employee].[Manager Name].[Manager Name].Members ,
    NOT InStr([Employee].[Manager Name].CurrentMember.MEMBER_NAME, "O-Tern"))
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM [OLSON BI]
    WHERE (
    [Employee Hours Time Category].[Time Category].&[Client Facing],
    [Employee Hours Time Category].[Utilization Category].&[PRODUCTION])
    CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT
    When running the query, I get the "Failed to parse the query to detect if it is mdx or dmx".
    THe qqy=uery is basic enough, but for the life of me can't figure out what is wrong????
    Any suggestions woud be greatly appreciated!!
    Thanks
    A. M. Robinson

    I literally have the exact same query running in a different report and it runs fine.
    Also, your FILTER is in a SET statement - mine is not. That is the major difference between my query and yours.
    SELECT
    [Measures].[Employee Hours],
    [Measures].[Employee Hours %]
    } ON COLUMNS,
    NON EMPTY CROSSJOIN(
    [Selected Departments],
    [Employee].[Employee Bill Rate].[Employee Bill Rate].ALLMEMBERS,
    [Employee].[Employee Level].[Employee Level].ALLMEMBERS,
    [TTM]) ,
    FILTER ([Employee].[Manager Name].[Manager Name].Members ,
    NOT InStr([Employee].[Manager Name].CurrentMember.MEMBER_NAME, "O-Tern"))
    If I remove the filter statement from this query and run it WITH the same parameters it runs fine - and has been running fine for literally over a year. The introduction of this FILTER statement is causing an issue.
    So either the filter is in the wrong place or it's not formed properly.
    I can provide a couple of examples of queries that are the ecact same with parameters and run fine, and when a FILTER is introduced they still run fine.
    A. M. Robinson

  • Generic MDX Statement

    Hi!
    What I'm looking for is the MDX equivalent of the SQL statement: "Select * from Table".
    What I want is a generic MDX statement that I can use to get all the measures and dimensions from a Cube or DSO.
    I know it's possible to get all the measures without knowing their names, but I want to know if it's possible to get all the dimensions without knowing their names...
    Any help would be greatly appreciated

    Hello,
    try this:
    SELECT
         [Measures].[ZKEYV01] +the key figures+
    ON COLUMNS,
         [ZCRIT2].[A11] +the characteristic+
         [ZCRIT] +the characteristic+
    ON ROWS
    FROM $ZCUBE  +the cube+
    WHERE (
         [ZCRIT].[000000]
    Here you can find a lot of links:
    http://www.mosha.com/msolap/mdx.htm
    Assign points if helpful
    Best regards,
    Alexander
    And a introduction:
    http://www.mosha.com/msolap/articles/MDXForEveryone.htm
    You can use transaction MDXTEST to test ist.

  • MDX Support for BPC on BW on HANA

    Hi All,
    I have the following queries on MDX support for BPC on BW on HANA -
    1. What is the current state of Dimension Member formulas (or MDX) with BPC on HANA. Are they natively being evaluated within HANA?
    2. Does BPC on HANA support the same MDX features and functionalities that BPC on any other database would ? Are there any limitations here ?
    Please advise. Thanks.

    Saurabh Diwakar,
    Does note 1714013 gives insight to any of your questions?
    BR
    Prabhith

  • 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

  • Problem with mdx statements generated by CR

    Hello Experts,
    we have a problem concerning mdx-statements produced by Crystal Reports.
    We have built a report upon a query with a variable. Now within one Designer, the generated mdx statement looks like this:
    SELECT {[Measures].[4LPEKDIGEPNC4ENQA7Z0TN7MH]} ON COLUMNS FROM [MC_CO2010/C_BO_BSDB_1] SAP VARIABLES [ZKS__MSM] INCLUDING "432140" : "432140"
    Within another installed designer (same version etc.), the statement looks like this:
    SELECT {[Measures].[4LPEKDIGEPNC4ENQA7Z0TN7MH]} ON COLUMNS FROM [MC_CO2010/C_BO_BSDB_1] SAP VARIABLES [ZKS__MSM] INCLUDING [KSTL].[432140] : [KSTL].[432140]
    And only this version shows the data !
    Personally I know only statements like the last one (variable values in brackets). But only the first one (variable values in double quotes) does work. Does anyone know the reason for this ? How can we then achieve that the CR designer produces statements like the first one ?
    Thanks for your help in advance,
    Frank

    We´ve solved the problem:
    I discovered that on the computer that generated the "" statement, only CR2008 with SP3 was installed. Wheresas on the pc that generated the -statement, SAP Integration Kit (SIK) CR2008 SP3 AND SIK CR2008 Fixpack 3 was installed. So I de-installed SIK CR2008 Fixpack 3 and then both machines generated the same statements with the "".
    @Ingo:
    No, both values had been entered manually, so there was no difference in this. As I wrote above, the only differences where the addionally installed FP3.
    Noneheless, the mdx-statement with the "" seems strange to me. Is this something official ? If I take a look at the description for BW-Specific Enhancement for MDX:
    http://help.sap.com/SAPhelp_nw04/helpdata/en/a7/18533d6dd60610e10000000a114084/content.htm
    the seem to be ok and it is also the way I am used to it.

  • I cannot access online statements for my credit card account when using firefox, but have no problem when using safari.

    When I attempted to check the monthly statement for my credit card account and clicked on "See statement", the next screen that appeared, which was labeled Online Statement", was blank. In the past, I have never had any problems with this. When I checked with the bank that issued the credit card, the representative I spoke with said that it was a browser issue and that, since I was working on a Mac, I should try using Safari. When I switched to Safari, I had no problem bringing up my statement. But I would prefer to be able to use Firefox to obtain information like this, since it's the browser I always use.

    Can you upgrade your browser to Firefox 12 and check?
    * getfirefox.com

  • VLD-1119: Unable to generate Multi-table Insert statement for some or all t

    Hi All -
    I have a map in OWB 10.2.0.4 which is ending with following error: -
    VLD-1119: Unable to generate Multi-table Insert statement for some or all targets.*
    Multi-table insert statement cannot be generated for some or all of the targets due to upstream graphs of those targets are not identical on "active operators" such as "join".*
    The map is created with following logic in mind. Let me know if you need more info. Any directions are highly appreciated and many thanks for your inputs in advance: -
    I have two source tables say T1 and T2. There are full outer joined in a joiner and output of this joined is passed to an expression to evaluate values of columns based on
    business logic i.e. If T1 is available than take T1.C1 else take T2.C1 so on.
    A flag is also evaluated in the expression because these intermediate results needs to be joined to third source table say T3 with different condition.
    Based on value taken a flag is being set in the expression which is used in a splitter to get results in three intermediate tables based on flag value evaluated earlier.
    These three intermediate tables are all truncate insert and these are unioned to fill a final target table.
    Visually it is something like this: -
    T1 -- T3 -- JOINER1
    | -->Join1 (FULL OUTER) --> Expression -->SPLITTER -- JOINER2 UNION --> Target Table
    | JOINER3
    T2 --
    Please suggest.

    I verified that their is a limitation with the splitter operator which will not let you generate a multi split having more than 999 columns in all.
    I had to use two separate splitters to achieve what I was trying to do.
    So the situation is now: -
    Siource -> Split -> Split 1 -> Insert into table -> Union1---------Final tableA
    Siource -> Split -> Split 2 -> Insert into table -> Union1

  • My imac will not load after I enter my password. The only thing I get is the arrow from my mouse on top of a blank white screen.  Can anyone tell me what this is?  I've restarted and turned off several times.  I left it on in this state for 8 hours and

    My imac will not load after I enter my password. The only thing I get is the arrow from my mouse on top of a blank white screen.  Can anyone tell me what this is?  I've restarted and turned off several times.  I left it on in this state for 8 hours hoping it would reload and work.  No luck.

    Hello KCC4ME,
    You may try booting your Mac in Safe Boot, as it can resolve many issues that may prevent a successful login.
    OS X: What is Safe Boot, Safe Mode?
    http://support.apple.com/kb/HT1564
    If a Safe Boot allows you to successfully log in, you may have issues with one or more login itmes (while the following article is labelled as a Mavericks article, it is viable for earlier versions of the Mac OS, as well).
    OS X Mavericks: If you think you have incompatible login items
    http://support.apple.com/kb/PH14201
    Cheers,
    Allen

  • How can I get  the MDX-statement which is generated in a query?

    Can I somehow get the MDX statement, which is generated when I create a Query via BeX Query Designer? I am using JCo to connect to BW (3.0b) and to execute MDX statements from a standalone JAVA-application. It would be very helpful to have the statements, so that I don't have to create them by myself.
    If this it not possible...is there any reference regarding the MDX statements, I could use?

    Hi Markus,
    The Query Designer generates no MDX, so you can't find any persisted MDX Statements. But you can do a trick, you can use the SAP BW OLE DB Provider in Excel. This Tool generates MDX Statements check this link:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/a06a51f3-0201-0010-8591-b742cfafd267
    I hope this helps.
    best regards
    Kai

  • How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column

    Please Help!!!
    How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column.
                                      January 2014         January
    2013                            +/-
                    Region   Entry   Exit  Total    Entry   Exit   Total   (Total of Jan2014-Total of Jan2013)
                    A               2         3      
    40        5       7        30                    40-30= 10

    What is a table structure? Sorry cannot test it right now..
    SELECT <columns>,(SELECT Total FROM tbl WHERE Y=2014)-(SELECT Total FROM tbl WHERE Y=2013)
    FROM tbl
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • Mac Mail on both my laptops suddenly will no longer sync with mobile me

    I have two macbooks - both of which sync with mobile me quite reliably. A couple of days ago, the Mac mail application stopped syncing with mobile me on both of my macbooks. When I tell it to syncronize with ".Mac" or get mail, I get the small triang

  • Why Do I get different result when Run as Admin to Standard?

    Why when Running this script to copy from the "config64" folder (if files exist)(if not copy from "config32")  if works correctly when running  Batch file normally (copies the config64), but using the exact same line when running the Batch file as "R

  • Mapping issue: FCC: Idoc for each record in file

    Hi, I have file to Idoc scenario. I receive csv file with multiple records. The requirement is to create an Idoc for each record. For eg. source file A1,B1,C1 A2,B2,C2 A3,B3,C3 After FCC <MT> <TRANS> <ROW> <A>A1</A> <B>B1</B> <C>C1</C> </ROW> <ROW> <

  • Iphone 5 not recognised

    Hi After updating to IOS 7 my Iphone 5 is now no longer recognised by itunes. I am running Windows 8 and have uninstalled and reinstalled itunes. My other devices ipad 2 and iphone 4s are both recognised.

  • How to consume data model adf library in view project?

    Hello, I am using Jdev 11.1.1.6. I have a Jdev workspace containing business component (entity objects, view objects and application module exposing the VOs). This workspace is deployed to an ADF Library. This library is packaged with DB connection d