Problem in  Inner join

Hi All,
selection screen
select-options:  vkorg for vbak-vkorg obligatory.  " Sales Org
select-options:  erdat for vbak-erdat. " Creation Date
select-options:  auart for vbak-auart. " Order type
select-options:  knkli for vbak-knkli. " Customer Account
Start-of-selection.
  select a~bstnk
         a~vbeln
         b~kdmat
         b~matnr
         b~werks
         b~posnr
         b~kwmeng
         into corresponding fields of table itab
         from  vbap as b inner join vbak as a on avbeln = bvbeln
       where vkorg in vkorg
       and auart in auart and knkli in knkli and erdat in erdat.
Error (During Ctrl F2)
The column name "ERDAT" has two meanings. ABAP/4 Open SQL Statement.
Kindly let me know what is this error msg.
Thanks
S

Hi,
There are conflicting names for erdat.
You have given the select-option name aslo as erdat.
change it to some other name say s_erdat.
select-options: s_erdat for vbak-erdat. " Creation Date
change the same in select also
Start-of-selection.
select a~bstnk
a~vbeln
b~kdmat
b~matnr
b~werks
b~posnr
b~kwmeng
into corresponding fields of table itab
from vbap as b inner join vbak as a on avbeln = bvbeln
where vkorg in vkorg
and auart in auart and knkli in knkli and erdat in s_erdat.
Hope it helps.
Reward if useful
Regards,
Saumya

Similar Messages

  • Performance problem with inner join

    Hi
    With this Query
    SELECT *
    FROM TABLE1
    INNER JOIN TABLE2
    ON TABLE1.Col1 = TABLE2.Col2 AND TABLE1.Col2 = TABLE2.Col2
    WHERE TABLE1.Col3 = 'AB' AND
    TABLE2.Col4 = 'ZZ';
    TABLE1 have 6,000,000 of records
    TABLE2 have 9,000,000 of records
    when I run this query the result take 30 secs
    If I change the Optimizer_mode for 'RULE'
    the result take 4 secs
    All statistics is ok
    Primary Key exists for TABLE1 and TABLE2 base-on Col1 and Col2
    And index on Table1.Col3,Table1.Col4
    somebody can help me ?

    Analyze tables compute statistics
    and analyze index compute statistics
    I join explain plan
    STATEMENT_ID TIMESTAMP REMARKS OPERATION OPTIONS OBJECT_NODE OBJECT_OWNER OBJECT_NAME OBJECT_INSTANCE OBJECT_TYPE OPTIMIZER SEARCH_COLUMNS ID PARENT_ID POSITION COST CARDINALITY BYTES
    OTHER_TAG PARTITION_START PARTITION_STOP PARTITION_ID OTHER DISTRIBUTION CPU_COST IO_COST TEMP_SPACE
    WithRule1 2004-01-19 16:28:43 SELECT STATEMENT RULE 0
    WithRule1 2004-01-19 16:28:43 SORT AGGREGATE 1 0 1
    WithRule1 2004-01-19 16:28:43 NESTED LOOPS 2 1 1
    WithRule1 2004-01-19 16:28:43 TABLE ACCESS BY INDEX ROWID MICRODEV T088_INSC 1 ANALYZED 3 2 1
    WithRule1 2004-01-19 16:28:43 INDEX RANGE SCAN MICRODEV IX4_T088_INSC NON-UNIQUE ANALYZED 2 4 3 1
    WithRule1 2004-01-19 16:28:43 TABLE ACCESS BY INDEX ROWID MICRODEV T090_CPOS_DEM 2 ANALYZED 5 2 2
    WithRule1 2004-01-19 16:28:43 INDEX UNIQUE SCAN MICRODEV PK_T090_CPOS_DEM UNIQUE ANALYZED 2 6 5 1
    7 rows selected.
    STATEMENT_ID TIMESTAMP REMARKS OPERATION OPTIONS OBJECT_NODE OBJECT_OWNER OBJECT_NAME OBJECT_INSTANCE OBJECT_TYPE OPTIMIZER SEARCH_COLUMNS ID PARENT_ID POSITION COST CARDINALITY BYTES
    OTHER_TAG PARTITION_START PARTITION_STOP PARTITION_ID OTHER DISTRIBUTION CPU_COST IO_COST TEMP_SPACE
    WithChoose1 2004-01-19 16:29:37 SELECT STATEMENT CHOOSE 0 21680 21680 1 40
    21680
    WithChoose1 2004-01-19 16:29:37 SORT AGGREGATE 1 0 1 1 40
    WithChoose1 2004-01-19 16:29:37 HASH JOIN 2 1 1 21680 59050 2362000
    21680 3875000
    WithChoose1 2004-01-19 16:29:37 TABLE ACCESS BY INDEX ROWID MICRODEV T088_INSC 1 ANALYZED 3 2 1 7031 96727 2708356
    7031
    WithChoose1 2004-01-19 16:29:37 INDEX RANGE SCAN MICRODEV IX4_T088_INSC NON-UNIQUE ANALYZED 2 4 3 1 232 96727
    232
    WithChoose1 2004-01-19 16:29:37 TABLE ACCESS FULL MICRODEV T090_CPOS_DEM 2 ANALYZED 5 2 2 11224 5662693 67952316
    11224
    6 rows selected.

  • Problem in Accession inner join with [Microsoft][SQLServer 2000 Driver

    Hi
    Can you tell me what can be cause my sql statement is correct gives result but
    if i used below statement in my JSP ,cause error
    1)
    ps1=connection.prepareStatement("select RQM_IN_RQSTN_ID_PK,RQD_IN_ITM_ID_FKPK,RQD_VC_ITM_DSCRPTN,RQD_IN_STTS_ID_FK,C.SMT_VC_STTS_NM,a.RQM_DT_PRPSD_DLVRY_DT"+
    "from PAS_RQM_RQSTN_MSTR a "+
    "inner join PAS_RQD_RQSTN_DTLS b on a.RQM_IN_RQSTN_ID_PK = b.RQD_IN_RQSTN_ID_FKPK and RQD_IN_STTS_ID_FK = 4"+
    "INNER JOIN PAS_SMT_STTS_MSTR C ON C.SMT_IN_STTS_ID_PK=B.RQD_IN_STTS_ID_FK" +
    "where a.RQM_VC_DTRTMNT_INVLV='Technology' ");
    2) Error Generate
    java.sql.SQLException
    [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 1: Incorrect syntax near 'a'.
    What can be the cause
    Thanks

    ps1=connection.prepareStatement("select
    RQM_IN_RQSTN_ID_PK,RQD_IN_ITM_ID_FKPK,RQD_VC_ITM_DSCRP
    TN,RQD_IN_STTS_ID_FK,C.SMT_VC_STTS_NM,a.RQM_DT_PRPSD_D
    LVRY_DT"+
    "from PAS_RQM_RQSTN_MSTR a "+
    "inner join PAS_RQD_RQSTN_DTLS b on
    a.RQM_IN_RQSTN_ID_PK = b.RQD_IN_RQSTN_ID_FKPK and
    RQD_IN_STTS_ID_FK = 4"+
    "INNER JOIN PAS_SMT_STTS_MSTR C ON
    C.SMT_IN_STTS_ID_PK=B.RQD_IN_STTS_ID_FK" +
    "where a.RQM_VC_DTRTMNT_INVLV='Technology' ");This is a problem due to not providing spaces where they are needed. See the places where I have highlighted.
    A better way is to generate the String first [use StringBuffer as a good practice for appending instead of String "+"] and print it out to check if it is correct.
    ***Annie***

  • Problem with a query inner-join

    Hello;
    I'm trying to innerjoin these 2 tables in my query for a page that will allow you to add / edit records. Right now, it's telling me I have a data mismatch. I don't see where I went wrong. Can someone help me out?
    This is my code:
    <cfparam name="url.CategoryID" type="integer" default="0">
    <cfparam name="subID" type="integer" default="#url.CategoryID#">
    <cfparam name="subName" default="">
    <cfparam name="CategoryID" default="">
    <cfparam name="Name" default="">
    <cfif url.CategoryID GT 0>
    <cfquery name="categRec" dataSource="#APPLICATION.dataSource#">
    SELECT merchSubCat.subName, merchSubCat.subID, Categories.CategoryID, Categories.Name
    FROM merchSubCat
    INNER JOIN Categories
        ON merchSubCat.CategoryID = Categories.CategoryID
    WHERE merchSubCat.subID = <cfqueryparam value="#url.CategoryID#" cfsqltype="cf_sql_integer">
    </cfquery>
    <!--- if the record was found, store the values --->
    <cfif categRec.RecordCount EQ 1>
    <cfset CategoryID = categRec.subID>
    <cfset subName = categRec.subName>
    <cfset CategoryID = categRec.CategoryID>
    <cfset Name = categRec.Name>
    </cfif>
    </cfif>
    this is my error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Type mismatch in expression.
    The error occurred in C:\Websites\187914kg3\admin\cms\merchant\merchSub-edit.cfm: line 16
    14 : INNER JOIN Categories
    15 :     ON merchSubCat.CategoryID = Categories.CategoryID
    16 : WHERE merchSubCat.subID = <cfqueryparam value="#url.CategoryID#" cfsqltype="cf_sql_integer">
    17 : </cfquery>
    18 :
    I don't see what I did wrong, can another pair of eyes see where I missed something?
    Thank you

    I changed it to number, and it works now.
    I have one other problem.. I'm trying to use a drop down menu in this form to edit a record. I want the drop down to show what is being used in the database when you go to edit a record. It runs on one query, to populate the select, but it pulls info from another and this isn't working. Actually, it's the innerjoin I just made.. can you help me?
    <!--- query that runs the select --->
    <cfquery name="catList" datasource="#APPLICATION.dataSource#">
    SELECT DISTINCT merchCategory.CategoryID, merchCategory.CatName AS cat_name
    FROM merchCategory
    ORDER BY CatName
    </cfquery>
    <cfselect enabled="No" name="CategoryID" size="1" class="smallText" multiple="no" query="catList" value="CategoryID" display="cat_name" queryPosition="below" selected="#categRec.Name#">
                      <option value="">--Select a Category--</option>
                  </cfselect>
    As you see, in the selected part of the tag, I'm trying to pull info from the other query we just fixed. I know this is wrong, how do I do this?

  • Report - INNER JOIN Problem

    Hi,
    In my report List of Block Customer's, INNER JOIN is not working..
    Code:----
    SELECT DISTINCT M1KUNNR M1KTOKD M1NAME1 M1CASSD M1AUFSD M1LIFSD M1~FAKSD INTO CORRESPONDING FIELDS OF TABLE ITAB
                        FROM KNA1 AS M1 INNER JOIN KNVV AS M2 ON M1KUNNR = M2KUNNR
                                               WHERE M1~KTOKD IN ('0001' , 'KTOKD')
                                                AND M1~CASSD EQ 'X'
                                                 OR M1~AUFSD NE ''
                                                 OR M1~LIFSD NE ''
                                                 OR M1~FAKSD NE ''
                                                 OR (M2~AUFSD NE ''
                                                 OR M2~LIFSD NE ''
                                                 OR M2~FAKSD NE ''
                                                 OR M2~CASSD EQ 'X'.
    Here, condition on 0001 is not matching..
    Plz tell me, what is the problem in it..
    Thanks
    Edited by: Prince Kumar on Oct 20, 2008 9:37 AM

    hi,
    please use " FOR ALL ENTRIES " as it is better performance wise also rather then inner joins
    and for syntax refer this code:
    Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.
    PARAMETERS p_city TYPE spfli-cityfrom.
    TYPES: BEGIN OF entry_tab_type,
             carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
           END OF entry_tab_type.
    DATA: entry_tab   TYPE TABLE OF entry_tab_type,
          sflight_tab TYPE SORTED TABLE OF sflight
                           WITH UNIQUE KEY carrid connid fldate.
    SELECT carrid connid
           FROM spfli
           INTO CORRESPONDING FIELDS OF TABLE entry_tab
           WHERE cityfrom = p_city.
    SELECT carrid connid fldate
           FROM sflight
           INTO CORRESPONDING FIELDS OF TABLE sflight_tab
           FOR ALL ENTRIES IN entry_tab
           WHERE carrid = entry_tab-carrid AND
                 connid = entry_tab-connid.
    thanks and regards
    RAHUL

  • Inner Join problem

    Hello guys,
    I have a problem in my select query. My query is turning empty. there isnt problem before without adding vbak table.Where is  problem?
    select  matnr fkdat matkl lfimg v~auart from lips
                inner join likp
                on LIKP~VBELN = LIPS~VBELN
                join vbak as v
                on likp~vbeln = v~vbeln
           into CORRESPONDING FIELDS OF TABLE itab_material
           where  LIPS~LFIMG ne 0 and likp~VKORG eq 'O001' and likp~WADAT_IST eq itab_plaka-fkdat.
    Thank you.,
    Regards,
    B.Y.

    Hi Bekir,
    In LIPS table, the 'VBELN' it`s not sales order number, it`s delivery order number,
    you need find out the sales order number from 'VBFA' by delivery order number.
    so your query should like this:
       select  lips~matnr fkdat matkl lfimg v~auart from lips
                inner join likp
                on LIKP~VBELN = LIPS~VBELN
                inner join vbfa
                on vbfa~vbeln = LIPS~VBELN
                inner join vbak as v
                on v~vbeln = vbfa~vbelv      
           into CORRESPONDING FIELDS OF TABLE itab_material
           where  LIPS~LFIMG ne 0 and likp~VKORG eq 'O001' and likp~WADAT_IST eq itab_plaka-fkdat.
    regards,
    Archer

  • About inner join problem

    Hi Friends,
    I have given the innerjoin between BKPF & BSEG tables,
    And i am fetching BUKRS, BELNR,GJAHR, BLART,BLDAT,BUDAT  fields from BKPF and BUZEi from BSEG table, but it is showing error as u cannot create inner join for BSEG table,
    Kindly help me on this .
    Thanks & Regards,

    Hi,
    I using the code like this,
    It displaying the output without displaying any data in BUZEI field,  Even i have given the field name in the field catalog.
    Could u plz help me on this,
    Waiting for ur reply.
    TYPES  : BEGIN OF T_BKPF,
            BUKRS TYPE BKPF-BUKRS,
            BELNR TYPE BKPF-BELNR,
            GJAHR TYPE BKPF-GJAHR,
            BLART TYPE BKPF-BLART,
            BLDAT TYPE BKPF-BLDAT,
            BUDAT TYPE BKPF-BUDAT,
            BUZEI TYPE BSEG-BUZEI,
            END OF T_BKPF.
    types: begin of t_bseg,
           BUKRS TYPE BSEG-BUKRS,
           BELNR TYPE BSEG-BELNR,
           GJAHR TYPE BSEG-GJAHR,
           end of t_bseg.
    DATA : it_bkpf TYPE STANDARD TABLE OF t_bkpf with header line,
          wa_bkpf TYPE t_bkpf,
           it_bseg type standard table of t_bseg.
          wa_bseg type t_bseg.
    select bukrs belnr gjahr from bseg into table it_bseg.
    perform data_retrieval_bseg.
    perform data_retrieval.
    form data_retrieval_bseg .
      select buzei from bseg into table it_bkpf.
    endform.                    " data_retrieval_bseg
    *&      Form  DATA_RETRIEVAL
    form data_retrieval.
    IF it_bseg[] IS NOT INITIAL.
       select bukrs belnr gjahr blart bldat budat from bkpf into
         table it_bkpf for all entries in it_bseg
         where bukrs = it_bseg-bukrs
         and belnr = it_bseg-belnr
         and gjahr = it_bseg-gjahr.
         endif.
    endform.

  • Help with Inner join problem

    The following query works fine as long as there is a value in the subID field, which is at the end of the inner join statement. If the subID is blank then no data is output, even though it is there. Try as I may, I can not get the right solution in the where statement to get the data to show without the subID. What am I missing?
    <cfquery name="getInfo" datasource="#application.database#">
    select page_id, pageName, pages.content, pages.cat_id, pages.seo_title,pages.seo_desc,pages.seo_words,pages.h1_title,pages.pic,pages.brochure,pa ges.video,catagories.catagory,subcat.subID,subcat.sub_category
    from (pages INNER JOIN catagories ON pages.cat_id = catagories.cat_id) INNER JOIN subcat ON pages.subID = subcat.subID
    where pages.page_id = #page_id#
    </cfquery>

    Rick,
    Looks like you need a LEFT OUTER join to the "subcat" table, so that all records for "pages" and "catagories" are returned even if no matching "subcat" records exist.  INNER joins will only return selected records when the tables on both sides of the join statement have matching values, while a LEFT OUTER (sometimes also known simply as a LEFT join) join will return *all* selected records from the table(s) on the left side of the join statement regardless of whether there are matching records from the table on the right side of the join statement.  When there are no matching records from the table on the right side of the join statement, any columns in your SELECT clause that are from the table on the right side of the join statement will contain NULLs.
    HTH,
    -Carl V.

  • INNER JOIN PROBLEM IN Microsoft SQL Server 2008 R2 Report Builder 3.0

    SELECT
    ,maximo_tbl_matrectrans.ponum
    ,maximo_tbl_po.description AS [maximo_tbl_po description]
    ,maximo_tbl_matrectrans.polinenum
    ,maximo_tbl_matrectrans.itemnum
    ,maximo_tbl_item.description AS [maximo_tbl_item description]
    FROM
    maximo_tbl_matrectran
    INNER JOIN maximo_tbl_po
    ON maximo_tbl_matrectrans.ponum = maximo_tbl_po.ponum
    INNER JOIN maximo_tbl_item
    ON maximo_tbl_matrectrans.itemnum = maximo_tbl_item.itemnum
    can you advise below picture in itemnum in show one value more time
    ponum polinenum maximo_tbl_a_po_description itemnum maximo_tbl_a_item_description
    D33-1021425 5 ASL REORDER HAZMAT 91G8110000071 DRUM, PLASTIC
    D33-1021425 5 ASL REORDER HAZMAT 91G8110000071 DRUM, PLASTIC
    D33-1020817 2 ASL REPLENISHMENT, D 91G6685000371 THERMOSTAT
    D33-1020817 2 ASL REPLENISHMENT, D 91G6685000371 THERMOSTAT
    D33-1020817 2 ASL REPLENISHMENT, D 91G6685000371 THERMOSTAT
    D33-1021365 2 ASL - D33DFAC STOCK 91G3920000081 CART, BIG WHEEL
    D33-1021365 2 ASL - D33DFAC STOCK 91G3920000081 CART, BIG WHEEL
    D33-1021425 5 ASL REORDER HAZMAT 91G8110000071 DRUM, PLASTIC
    D33-1020817 1 ASL REPLENISHMENT, D 91G5330002011 SEAL, THERMOSTAT
    D33-1022346 2 ASL STOCK REORDER E 92G6145000998 CABLE, POWER,
    D33-1022346 2 ASL STOCK REORDER E 92G6145000998 CABLE, POWER,
    D33-1020817 1 ASL REPLENISHMENT, D 91G5330002011 SEAL, THERMOSTAT
    D33-1020817 1 ASL REPLENISHMENT, D 91G5330002011 SEAL, THERMOSTAT
    D33-1022346 2 ASL STOCK REORDER E 92G6145000998 CABLE, POWER,
    but original we need..
    ponum polinenum maximo_tbl_a_po_description itemnum maximo_tbl_a_item_description
    D33-1021425 5 ASL REORDER HAZMAT 91G8110000071 DRUM, PLASTIC
    D33-1020817 2 ASL REPLENISHMENT, D 91G6685000371 THERMOSTAT
    D33-1021365 2 ASL - D33DFAC STOCK 91G3920000081 CART, BIG WHEEL
    D33-1020817 1 ASL REPLENISHMENT, D 91G5330002011 SEAL, THERMOSTAT
    D33-1022346 2 ASL STOCK REORDER E 92G6145000998 CABLE, POWER,

    Try below:
    SELECT DISTINCT
    maximo_tbl_matrectrans.ponum
    ,maximo_tbl_po.description AS [maximo_tbl_po description]
    ,maximo_tbl_matrectrans.polinenum
    ,maximo_tbl_matrectrans.itemnum
    ,maximo_tbl_item.description AS [maximo_tbl_item description]
    FROM
    maximo_tbl_matrectran
    INNER JOIN maximo_tbl_po
    ON maximo_tbl_matrectrans.ponum = maximo_tbl_po.ponum
    INNER JOIN maximo_tbl_item
    ON maximo_tbl_matrectrans.itemnum = maximo_tbl_item.itemnum
    -Vaibhav Chaudhari

  • Problem when doing inner join for three tables....

    DATA: V3 TYPE VBAP-MAKTL.
    SELECT single vbap~matkl into V3
           from VBAP
           inner join VBFA
           inner join LIPS
              on LIPSPOSNR = VBFAPOSNN
              and vbapvbeln = vbfavbelv
               and vbapposnr = vbfaposnv
                 where LIPSVBELN = VBFAVBELN = '0080000834'
                 and vbfa~vbtyp_n = 'J'
                 and LIPS~J_3ASIZE = '0884'.
    Error: Wrong expression "INNER" in from clause...

    Hello Tushar,
      Why you are using the 3 table inner join. If the volume of data is big then this statement will give to time out. Use "for all entries" statement to select the data from the table.
    Like
    select field1 field2 from LIPS into i_lips
        where LIPS~J_3ASIZE = '0884'.
    select f3 f4 from vbfa into i_vbfa for all entries in i_lips where field1 = i_lips-field1 and so on
    and 
    use same to select data from VBAP.
    Hope this will help

  • Inner Join performance problem.

    Hi,
    I wrote a select statement using inner join on table VBRK , VBUK, VBAP and VBRP.
    This select statement is working fine from last two years, but suddenly to execute this select statement
    taking lot of time and program going to dump.
    But same select statement is working in development and quality systems and not working in production system. Based on given selection we check the tables in production we found only 10 records, but to fetch these 10 records also it will taking lot of time and going to dump.
    can anyone please advise on the same.
    Thanks in advance.

    Hi,
    Please:
    1. Create DB view instead of inner join
    2. Use the primary key of the base table (the first or main table in your view) in your where clause
    3. If not possible, then you need to create secondary index in your base table that match with your where clause fields.
    4. Try to use positive relationship operator, like EQ instead NE, GT, etc.
    Hope it helps.
    Lim...

  • Problem with outer join with filter on join column

    Hi,
    In physical layer I have one dimension and two facts, and there's an outer join between the facts.
    dim_DATE ,
    fact_1 ,
    fact_2
    Joins:
    dim_DATE inner join fact_1 on dim_DATE.DATE = fact_1.DATE
    fact_1 left outer join fact_2 on fact_1.DATE = fact_2.DATE and fact_1.SOME_ID = fact_2.SOME_ID
    When I run a report with a date as a filter, OBIEE executes "optimized" physical SQL:
    select fact1.X, fact2.Y
    from
    Fact_1 left outer join on fact_1.DATE = fact_2.DATE and fact_1.SOME_ID = fact_2.SOME_ID
    where Fact_1.DATE = TO_DATE('2009-05-28' , 'YYYY-MM-DD' )
    and  Fact_2.DATE = TO_DATE('2009-05-28' , 'YYYY-MM-DD')
    The filter on Fact_2.DATE effectively replaces outer join with inner.
    Is there a way to disable this "optimization", which is actually very good for inner joins, but doesn't allow outer joins?
    Thanks in advance,
    Alex
    Edited by: AM_1 on Aug 11, 2009 8:20 AM

    If you want to perform a Fact-based partitioning with OBIEE (two fact with the same dimension), you have to :
    * create in your physical layer for each fact table the joins with the dimension
    * create in the Business Model layer ONE star schema with ONE logical fact table containing the columns of your two physical fact table
    In this way when you choose minimal one column of your fact1 and one column of your fact2, OBIEE will perform two query against each fact table/dimension, join them with an OUTER JOIN and your problem will disappear.
    Cheers
    Nico

  • Convert SSRS dropdown MDX query to INNER JOIN w/ NONEMPTY? Having hard time with this.

    I'm having an incredibly hard time with this, mostly because I'm very new with MDX.
    I created a simple report (with AdventureWorksDW) whose datasource is an SSAS cube. I select a datekey from the dropdown menu, and the report displays [Measures].[Order Quantity] for that day.
    The problem is that the dropdown displays every single value from the dimdate dimension. DimDate goes from 20050101 to 20201231, so the dropdown is very long.
    How can I alter the SSRS-generated MDX so that it does an INNER JOIN with Fact table and only the dates shown in the dropdown are the ones where there's data in the Fact table?
    Currently, the fact table only has 2 days of data (20141015, 20141016), which means that the dropdown should only display those two dates. I'm including the generated code MDX that populates the dropdown menu:
    WITH MEMBER [Measures].[ParameterCaption] AS
    [Dim Date].[Date Key].CURRENTMEMBER.MEMBER_CAPTION
    MEMBER [Measures].[ParameterValue] AS
    [Dim Date].[Date Key].CURRENTMEMBER.UNIQUENAME
    MEMBER [Measures].[ParameterLevel] AS
    [Dim Date].[Date Key].CURRENTMEMBER.LEVEL.ORDINAL
    SELECT {[Measures].[ParameterCaption],
    [Measures].[ParameterValue], [Measures].[ParameterLevel]}
    ON COLUMNS , [Dim Date].[Date Key].ALLMEMBERS ON ROWS
    FROM [Adventure Works cube]
    Any help is appreciated.
    VM

    Hi vmhatup,
    you can get rid of blank data using nonempty function and get rid of negative values using filter function nonempty should be inside of filter so it applies first, otherwise it is too slow.
    Your statement could look like this
    WITH MEMBER [Measures].[ParameterCaption] AS
    [Dim Date].[Date Key].CURRENTMEMBER.MEMBER_CAPTION
    MEMBER [Measures].[ParameterValue] AS
    [Dim Date].[Date Key].CURRENTMEMBER.UNIQUENAME
    MEMBER [Measures].[ParameterLevel] AS
    [Dim Date].[Date Key].CURRENTMEMBER.LEVEL.ORDINAL
    SELECT {[Measures].[ParameterCaption],
    [Measures].[ParameterValue], [Measures].[ParameterLevel]}
    ON COLUMNS
    , filter(
    nonempty([Dim Date].[Date Key].[Date Key],measures.measureName)
    ,measure.measurename >0
    ON ROWS
    FROM [Adventure Works cube]
    Jiri Neoral

  • Inner joins

    Hi
    i got struck up at the below code. i want to move all my data into strans table.
    FORM RETRIEVE_DATA .
      CLEAR: WA_MKPF.
       SELECT CPUDT CPUTM XBLNR FROM MKPF INTO ZMKPF WHERE CPUDT IN
        S_DATE.
      CLEAR:    WA_LIPS.
        If Zmkpf-cpudt = s_date-low.
        check Zmkpf-cputm GE p_time1.
        endif.
        If Zmkpf-cpudt = s_date-high.
        check Zmkpf-cputm lE p_time2.
        endif.
        APPEND ZMKPF.
        ENDSELECT.
       CLEAR WA_LIKP.
    SELECT SINGLE VBELN ERDAT ERZET KUNNR FROM LIKP INTO WA_LIKP
           WHERE VBELN = WA_MKPF-XBLNR.
    check: s_LFART.
    SELECT POSNR CHARG LFIMG MATNR VGBEL FROM LIPS INTO WA_LIPS
           WHERE VBELN = WA_MKPF-XBLNR.
    CLEAR WA_VBAK.
    *LOOP AT ZMKPF into wa_zmkpf.
      SELECT LIKPVBELN LIKPERDAT LIKPERZET LIKPKUNNR LIPS~POSNR
      LIPSCHARG LIPSLFIMG LIPSMATNR LIPSVGBEL INTO CORRESPONDING FIELDS
      OF TABLE ZLIKP FROM LIKP INNER JOIN LIPS ON LIKPVBELN = LIPSVBELN.
    INNER JOIN ZMKPF ON LIKPVBELN = ZMKPFXBLNR.
      WHERE LIKP~VBELN = WA_ZMKPF-XBLNR.
    *ENDLOOP.
    BREAK-POINT.
    IF NOT ZLIKP[] IS INITIAL.
      SELECT VBELN AUGRU FROM VBAK INTO TABLE ZVBAK
        FOR ALL ENTRIES IN ZLIKP
          WHERE VBELN = ZLIKP-VGBEL.
    ENDIF.
    CHECK: S_AUART.
      REFRESH STRANS.
      CLEAR STRANS.
      LOOP AT ZLIKP.
      W_TABIX = SY-TABIX.
      SHIFT ZLIKP-VBELN LEFT DELETING LEADING '0'.
      SHIFT ZLIKP-CHARG LEFT DELETING LEADING '0'.
      SHIFT ZLIKP-KUNNR LEFT DELETING LEADING '0'.
      SHIFT ZLIKP-POSNR LEFT DELETING LEADING '0'.
    CLEAR RTAB.
      MOVE ZLIKP-VBELN TO STRANS-VBELN.
      CONCATENATE ZLIKP-ERDAT(4) '-' ZLIKP-ERDAT+4(2) '-'
          ZLIKP-ERDAT+6(2) INTO V_DATE.
      CONCATENATE ZLIKP-ERZET(2) ':' ZLIKP-ERZET+2(2) ':'
          ZLIKP-ERZET+4(2) INTO V_TIME.
      CONCATENATE V_DATE V_TIME INTO STRANS-ERDAT SEPARATED BY SPACE.
      MOVE ZVBAK-AUGRU TO STRANS-AUGRU.
      MOVE ZVBAK-VBELN TO STRANS-VBELN.
      select single a~sort2 from kna1 as k
                      inner join adrc as a
                      on kadrnr = aaddrnumber
              into g_zcorp_id
           where k~kunnr = ZLIKP-KUNNR.
       if sy-subrc = 0.
         concatenate 'U' g_zcorp_id into g_zcorp_id.
         condense g_zcorp_id no-gaps.
       endif.
      MOVE G_ZCORP_ID TO STRANS-KUNNR.
      CONCATENATE ZLIKP-VBELN '-' ZLIKP-POSNR INTO VTRANS.
      MOVE VTRANS     TO STRANS-STRANS.
      MOVE ZLIKP-MATNR TO STRANS-MATNR.
      MOVE ZLIKP-CHARG TO STRANS-CHARG.
      MOVE ZLIKP-LFIMG TO STRANS-LFIMG.
      APPEND strans.
    ENDLOOP.
    ENDFORM.                    " RETRIEVE_DATA

    where the problem raises?

  • Why can't i use "INNER JOIN" in a query for SQL Server with JDBC??????

    Hi,
    I'm trying to execute some SQL queries and I just don't understand what's wrong.
    I�m using Tomcat and SQL Server in order to do this, but when I�m try to execute a query with a INNER JOIN statements Tomcat raise a SQL exception... at the very first time I thought there was a problem with database connection but I realize that a simple query to a table works pretty well. then I found out some problems with JDBC:ODBC.... so I install JDBC for SQL Server 2000 and test with the same simple query and works..... so, I come to a conclusion.... INNER JOIN or JOIN statements can't be used in JDBC..... please... somebody tell I�m wrong and give me a hand...
    I'm using TOMCAT 4 and JDK 1.4 SQL Server 2000
    Error occurs when executeQuery() is called.... not prepareStatement().... ??????
    Driver DriverRecResult = (Driver)Class.forName(driver).newInstance();
    Connection ConnRecResult = DriverManager.getConnection(DSN,user,password);
    PreparedStatement StatementRecResult = ConnRecResult.prepareStatement(query);
    ResultSet RecResult = StatementRecResult.executeQuery(); <---- Exception raise here
    So much tahnks in advance,

    That's exactly what I think, driver it's raising the exception, but I don't know why.... i test the same query with INNER JOIN directly from SQL Query Analyser and it's works perfectly, my problem ain't SQL, but JSP and JDBC 'cause i'm a newbie about these issues.
    Common sense tell me possible problems lie in SQLServer drivers 'cause i run the same pages on JRUN through jdbc:odbc and do works well, but by now i just depend on Tomcat.....
    I've installed SQL Server drivers for JDBC but i just find it doesn't work fully... could be the version of JDK i've installed? what version do i need?
    ( I'm running Tomcat 4 with JDK 1.4 & SQL Server 2000 W2K )
    thanks for reply.

Maybe you are looking for

  • Workflow tables for documents in FICO

    Hi all, Can anyone say what are the tables present in FICO, to identify whether a document is a Workflow Invoice or a non-workflow invoice? Thanks in advance. Regards, Swathi

  • Down Payment Accounts

    Hi everybody, following up to my thread "G/L Account Determination - meaning of accounts" I precise my question regarding the down payment accounts in this separate thread. I've made several simulations of Down Payment Processes on a demo database (u

  • Import settings pop up menu resize handle missing

    In the import window the pop up menu for import settings has the right side blocked and there is no way to resize it.

  • Rank function in sql

    Hi All, May I know the options oracle provides to know the first non null value in a group Thanks in advance

  • How to create 2 RKFs in Universe

    Hello, I am trying to develope 2 restricted key figures in Universe. I follwed the white paper given by Ingo. I better explain with example; 1. Created a 'Measure1' and wrote MDX in properties with a prompt on 'Doc Type'. And when I run the Webi, the