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

Similar Messages

  • 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

  • "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

  • 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.

  • Applying filter to all states in animation

    Hi, im new to fireworks for animating.
    I have a bunch of images (about 150) in an animations and i wanted to apply a color fill filter to all states. What is the most effective way to do this?
    Thank you

    One way to apply filters to multiple states is by onion skinning. It basically makes all objects clickable at once, regardless of what states they're on.
    Click on the small button in the lower left corner of the States panel. Make sure that "No Onion Skinning" is unchecked, and "Multi-State Editing" is checked. Also, if you want to apply the effect to all of your states, check "Show All States" as well.
    Now, while you are in the first state of animation, switch to the Select Behind tool (hit 0 to toggle from the regular selection tool). Hold down Shift and repeatedly click on the canvas to select objects from consecutive states. You can check if it works by looking at the radio buttons on the rightmost side of each state in the States panel. With each click, the radio button in the next state gets marked.
    When you're done with the selection, set the live filter as you normally would with a single object, and it will automatically apply to all selected objects in all states.
    It's still a tedious method when there are a lot of objects involved, like in your case. Not only it's a lot of individual selections, but also rapid clicking will be registered as a double-click, changing the Select Behind tool to one of the marquee tools.
    There might be a more efficient way, but it requires some experience with blend modes. The steps are the following:
    Make a new layer, right-click it and select "Share Layer to States". Make sure that this layer is the topmost layer in the stack.
    Draw a rectangle with solid fill, no stroke. Make sure it that  it spans the entire animated area.
    With the rectangle selected, play around with the Blend modes (in the upper left corner of the Layers panel), until you get the color effect you're looking for. The color change will affect the entire animation, just as if you applied a color fill to all objects. The final look will depend on the rectangle's initial color, the blend mode, and the colors of the underlying objects.
    Good luck!
    SiamJai
    Innovative Fireworks Tutorials

  • 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

  • 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.

  • 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

  • SAP MDX statement size limit ???

    Hi all,
    we are developing complex stuff with MDX and now the question comes up, if there is any limit in the MDX statement size in SAP Abap world. The main handler classes are CL_RSR_MDX_COMMAND, CL_RSR_MDX_OLAP_REQUEST does anyone here know if there is a limit in the MDX statement size ???
    Thx a lot !

    Not sure on the MDX but from a OLAP statement point of view - a straight SQL against an Oracle tablehas a limit of 32k and in unicode 64k
    I am seeing some interesting scenarios when SQLs are fired through the application and not direct..
    A select with multiple in clauses will first try and do a between on the SIDs - if that fails it will build an in clause..
    On the phsical level the SQL is partitioned up and fired mutliple times (obviously to get aroudn the 32k/64k limit)
    However in a virtual cube scenario - a function module can only call 200-250 (hard coded!) statements on an in clause - you can override this but risk a database error on too long a SQL statement..
    THis may or may not help.. but it's all background

  • Filter Function in MDX statement

    Hi Experts,
    I have a question on MDX, i hope this is the right place to post.
    I want to exclude a certain value of an infoobject in MDX output. How can i achieve this?

    Though not recommended for huge sets - are you not able to use things like not equal or not in list in your query filters?
    Anyways google " OLAP universes best practices" - its a good document

  • In how many ways we can filter this select statement to improve performance

    Hi Experts,
    This select statement taking 2.5 hrs in production, Can we filter the where condition, to improve the performance.Plz suggest with coding ASAP.
    select * from dfkkop into  table t_dfkkop
               where   vtref   like 'EPC%'        and
                   ( ( augbd      =  '00000000'   and
                       xragl      = 'X' )
                               or
                     ( augbd between w_clrfr and  w_clrto )  )  and
                       augrd      ne '03'         and
                       zwage_type in s_wtype .
    Regards,
    Sam.

    if it really takes 2.5 hours, try the followingtry to run the SQL trace and
    select *
              into table t_dfkkop
              from dfkkop
              where vtref like 'EPC%'
              and augbd = '00000000' and xragl
             and augrd ne '03'
             and zwage_type in s_wtype .
    select *
              appending table t_dfkkop
              from dfkkop
              where vtref like 'EPC%'
             and augbd between w_clrfr and w_clrto 
             and augrd ne '03'
             and zwage_type in s_wtype .
    Do a DESCRIBE TABLE after the first SELECT and after the second,
    or run an SQL Trace.
    What is time needed for both parts, how many records come back, which index is used.
    Siegfried

  • Filter Question - compound statement "OR" clause

    Hi
    I am trying to filter records which contain multiple conditional statements; (all comparisons are on DATE values)
    Example:
    If column_A is NULL OR ( columnA=ColumnB )
    I tried this: which worked for the first condition
    FILTER (1=(@COLTEST(COLUMN_A,NULL)) ;
    And then tried to add the second clause
    FILTER (1=(@COLTEST(COLUMN_A,NULL)) OR 0=@STRCMP(@IF(@COLTEST(COLUMN_A,NULL),0,COLUMN_A), @IF(@COLTEST(COLUMN_B,NULL),0,COLUMN_B))) );
    I've tried CASE, EVAL and just a straight OR as well with no success. Unfortunately the 'where' clause has multiple compound statements.
    Does anyone have any tips for this?
    Thanks

    I think there is an extra closing bracket at the end. Also, give spaces after the @ functions. Could you try the below?
    FILTER ( 1 = (@COLTEST(COLUMN_A,NULL)) OR 0 = @STRCMP ( @IF (@COLTEST (COLUMN_A,NULL),0,COLUMN_A), @IF (@COLTEST (COLUMN_B,NULL),0,COLUMN_B) ));

  • Filters In MDX Statement

    I've got an MDX query that I need to add a FILTER to and not quite sure how to accomplish this without ruinging the results of the original query.
    Here is the original query:
    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])
    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_NAME, FONT_SIZE, FONT_FLAGS
    I'd like to add this additional filter to the above query:
    FILTER ([Employee].[Manager Name].[Manager Name].Members ,
    NOT InStr([Employee].[Manager Name].CurrentMember.MEMBER_NAME, "O-Tern")
    If anyone can provide any guidance on this, it would be greatly appreciated!
    Thanks!
    A. M. Robinson

    Hello,
    Try something like below.
    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 Exists(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, NOTInStr([Employee].[Manager Name].CurrentMember.MEMBER_NAME, "O-Tern"))<o:p></o:p>
    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_NAME, FONT_SIZE, FONT_FLAGS

  • Filter a input statement

    Hi all,
    I have a smal problem. I am buidling a servlet that puts text into a database some of the users like to use a ' intp the text that the enter into that database. The problem is i have to put the ' into the database but when i am trying the sql command looks like this:
    INSERT INTO PRODINFO (INFO) (this is some info and i like to use a ' in my info)
    The database is trying to insert 2 parts of text and generates a error.
    How do i put a ' into the database is there a wildcard. And how do i filter this out and place the wildcard in place?
    Thanks already.
    Johan.
    [email protected]

    Use a prepared statement and pass in the string value via the input parameters like this.....
    String sql = "INSERT INTO PRODINFO (INFO) (?)";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setString(1,"the text");
    ps.executeUpdate();
    Jon.

Maybe you are looking for

  • Error while integrating OBIEE report with EBS using Rich Content Container

    I am trying to integrate OBIEE report with EBS using Rich Content Container OAF functionality. I have followed the steps mentioned in oracle Note - Embedding Analytics in Oracle E-Business Suite [ID 974422.1]. When i run my page, the container region

  • Power on a 23inch Cinema Display

    Hi, My display was working fine this morning. When I went to turn it on later, the power light wouldn't come on when I pressed the power button. I took the monitor to apple this evening and the monitor worked fine. When I got home it went back to no

  • DAM Images taking more then usual time to load

    Hi All, I have a problem in reducing image load time. I am using CQ5.4 and more than 60% of page load time consumed by images ( eg.20KB png image from DAM taking 2 sec to load).

  • Infospokes -Data transfer to third party

    Hello Folks, Im now working on SAP BW 3.5 system. I need to transfer data from SAP BW DSO/ODS object to an Oracle Database. I am thinking of using Infospokes to achieve this requirement. My findings: In the Destination tab of the Infospoke maintanenc

  • Unexpected File Format in Flash Pro 8

    Hi, I have downloaded the trial version of Flash Professional 8 for a homework assignment and when I try to open the file that the professor gave us I get  an error that states "Unexpected File Format"  I have tried almost everything to fix the file