Cross Join in Power Query

Is it possible to create a cross join between queries in Power Query?
I plan to use a table holding budgetlines that i want to cross join with a timetable to create monthly budgetlines.
Thanks, Menno van Leewen

Hi Menno,
Yes, it's possible to perform different kinds of join operations in Power Query, including a cross join. Please check out this page for more information on the different options,
http://office.microsoft.com/en-us/excel-help/table-join-HA104112136.aspx
The library specification also contains a description about the different Join Kinds (around page 164):
http://office.microsoft.com/en-us/excel-help/learn-about-power-query-formulas-HA104003958.aspx?CTT=5
According to your description, I think you will want to do a full outer join. It should look similar to this:
Table.Join(Customers, "CustomerID",Table.PrefixColumns(Orders, "Order"), "Order.CustomerID", JoinKind.FullOuter)
Thanks,
M.

Similar Messages

  • Cross joins on queries

    HI,
        how we can apply cross joins on select query.plz help me .I am using tables ekko,ekpo and lfa1 .Plz help.

    Hi Amardeep,
    as code given by one of guru's in the above joins statement is good when only if use the KEY-FIELDS in where condition if not it causes performance issue , so that you can use the FOR ALL ENTRIES IN statement which it gives good perfomance.
    Table declarations
    TABLES: ekko, "Purchasing Document Header
            ekpo, "Purchasing Document Item
            lfa1. "Vendor Master (General Section)
    Declaration of types:
    data: BEGIN OF tbl_ekko,
             ebeln TYPE ebeln,
             lifnr TYPE lifnr,
           END OF tbl_ekko.
    data: BEGIN OF tbl_ekpo,
             ebeln TYPE ebeln,
             ebelp TYPE ebelp,
           END OF tbl_ekpo.
    data: BEGIN OF tbl_lfa1,
             lifnr TYPE lifnr
             ebelp TYPE ebelp,
           END OF tbl_lfa1.
    *Selection screen:
    PARAMETERS: p_lifnr TYPE lifnr,
                             p_ebeln type ebeln.
    Selection (JOIN):
    START-OF-SELECTION.
    SELECT lifnr
       FROM lfa1
        INTO  table tbl_lfa1
    WHERE lifnr EQ p_lifnr.
    if sy-subrc = 0.
    sort tbl_lfa1 by lifnr.
    endif.
    if not tbl_lifnr is initial.
    SELECT ebeln lifnr
       FROM ekko
        INTO  table tbl_ekko
         FOR ALL INTRIES IN tbl_lfa1
    WHERE ebeln EQ p_ebeln
         AND  lifnr EQ tbl_lfa1-lifnr.
    if sy-subrc = 0.
    sort tbl_ ekko by ebeln.
    endif.
    endif.
    if not tbl_ekko is initial.
    SELECT ebeln ebelp
       FROM ekpo
        INTO  table tbl_ekpo
         FOR ALL INTRIES IN tbl_ekko
    WHERE ebeln EQ tbl_ekko-eblen.
    if sy-subrc = 0.
    sort tbl_ ekpo by ebeln.
    endif.
    endif.
    END-OF-SELECTION.
    Main program logic:
      LOOP AT tbl_ekpo.
    read table ekko with key ebeln = tbl_ekpo-ebeln BINARY SEARCH.
    if sy-subrc = 0
        WRITE: / tbl_ekko-ebeln,
                      tbl_ekko-ebelp,
                      tbl_ekpo-lifnr.
    endif.
      ENDLOOP.
    <b>NOTE : use only KEY-FIELDS in WHERE condition for better perfomance</b>
    In that above code you can change a/c to ur inputs availabe.
    <b>Reward with points if helpful.</b>
    Regards,
    Vijay

  • Error occurred when executing query involving cross join or outer join

    Hi,
    I tried to execute the following query:
    select count(*)
    from
         po,
         invoice,
         table(xmlsequence(extract(invoice.content, '/CommercialInvoice/Body/LineItemDetails/LineItem'))) invoice_line_item
    where
         extractValue(po.content, '/PurchaseOrder/Header/DocumentID/RID') =
         extractValue(value(invoice_line_item), '/LineItem/Product/PurchaseOrderIdentifier/documentCreatorIdentifier')(+)
    It produced the following error:
         Error: ORA-00936: missing expression
    Then I change the query to:
    select count(*)
    from
         po left outer join
              invoice cross join
              table(xmlsequence(extract(invoice.content, '/CommercialInvoice/Body/LineItemDetails/LineItem'))) invoice_line_item
         on
              extractValue(po.content, '/PurchaseOrder/Header/DocumentID/RID')
              = extractValue(value(invoice_line_item), '/LineItem/Product/PurchaseOrderIdentifier/documentCreatorIdentifier')
    It produced the following error:
         Error: ORA-00904: "INVOICE"."SYS_NC0012900130$": invalid identifier
    If I simply the query to:
    select 1
    from
         invoice cross join
         table(xmlsequence(extract(invoice.content, '/CommercialInvoice/Body/LineItemDetails/LineItem'))) invoice_line_item
    It also produced the following error:
         Error: ORA-00904: "INVOICE"."SYS_NC0012900130$": invalid identifier
    What is the cause of the problem? How to resolve it?
    The version I am using is 10.1.0.2.0 on Windows. Any help would be much appreciated.

    Hi,
        Recently we went for BW upgradatiaon (BI7.0) , the error you are facing could be due to the following issue,
        If infoobjects are used in infoset as infoprovider ( in BW3.5) after upgrade this infoobjects will not be selected automatically as infoproviders. So it will not be available for Infoset.
    Please check whether any infoobjects are used as infoprovider, if so manually change them as infoprovider ( In BI7) and activate.
    Since, few reports are working on the infoset , this could be those reports are not using the fields from the infoobjects. so it is working it seems.
    Please check and let me know.
    Thanks,
    V.Senthil

  • Inline query vs cross join

    Hi all,
    Two tables who have no relation with each other. For example an employees table and a systemparameter table with a startworktime.
    We need a query with data from both tables:
    Get all employees and the startworktime (which is the same for everybody)
    Which is cheaper: an inline query or a cartesian product or crossjoin?
    Inine :
    select name, function
           , (select startworktime from systemparameter)
    from employees;
    Cartesian product:
    select name, function, startwoime
    rktfrom employees
    cross join systemparameter;
    Your thoughts on this.

    Hi,
    To see which runs faster on your system, with your sub-query, there's no sibstitute for testing on your system, with your sub-query.
    I predict you won't notice any difference.  Scalar sub-queries (as in your first example) are cached (at least in recent versions of Oracle), so you can include a scalar sub-query in a result set of a million rows, and the sub-query can be executed once, not a million times.

  • How to avoid duplicates in CROSS JOIN Query

    Hi,
    I am using CROSS JOIN to get all the subset of a table col values as shown below:
    PRODUCT (Col Header)
    Bag
    Plate
    Biscuit
    While doing cross join we will get as
    Bag Bag
    Bag Plate
    Bag Biscuit
    Plate Bag
    Plate Plate
    Plate Biscuit ..... like this
    By placing where condition prod1 <> prod2 to avoid Bag Bag and Plate Plate values. So the output will be like below
    Bag Plate
    Bag Biscuit
    Plate Bag
    Plate Biscuit
    Now "Bag Plate" and "Plage Bag" are same combination how to avoid these records. My expected result is
    Bag Biscuit
    Plate Biscuit
    How to derive this ?
    Sridhar

    Hi,
    This is the the solution that I found as fit to the OP question, but
    Visakh16 already posted the same idea (assuming the names are unique) from the start and I don't think that anyone notice it!
    Sridhar.DPM did
    you check Visakh16's response
    (the second response received)?!?
    I will mark his response as an answer. If this is not what you need pls clarify and you can unmark it :-)
    [Personal Site] [Blog] [Facebook]

  • [8i] Need help with full outer join combined with a cross-join....

    I can't figure out how to combine a full outer join with another type of join ... is this possible?
    Here's some create table and insert statements for some basic sample data:
    CREATE TABLE     my_tab1
    (     record_id     NUMBER     NOT NULL     
    ,     workstation     VARCHAR2(4)
    ,     my_value     NUMBER
         CONSTRAINT my_tab1_pk PRIMARY KEY (record_id)
    INSERT INTO     my_tab1
    VALUES(1,'ABCD',10);
    INSERT INTO     my_tab1
    VALUES(2,'ABCD',15);
    INSERT INTO     my_tab1
    VALUES(3,'ABCD',5);
    INSERT INTO     my_tab1
    VALUES(4,'A123',5);
    INSERT INTO     my_tab1
    VALUES(5,'A123',10);
    INSERT INTO     my_tab1
    VALUES(6,'A123',20);
    INSERT INTO     my_tab1
    VALUES(7,'????',5);
    CREATE TABLE     my_tab2
    (     workstation     VARCHAR2(4)
    ,     wkstn_name     VARCHAR2(20)
         CONSTRAINT my_tab2_pk PRIMARY KEY (workstation)
    INSERT INTO     my_tab2
    VALUES('ABCD','WKSTN 1');
    INSERT INTO     my_tab2
    VALUES('A123','WKSTN 2');
    INSERT INTO     my_tab2
    VALUES('B456','WKSTN 3');
    CREATE TABLE     my_tab3
    (     my_nbr1     NUMBER
    ,     my_nbr2     NUMBER
    INSERT INTO     my_tab3
    VALUES(1,2);
    INSERT INTO     my_tab3
    VALUES(2,3);
    INSERT INTO     my_tab3
    VALUES(3,4);And, the results I want to get:
    workstation     sum(my_value)     wkstn_name     my_nbr1     my_nbr2
    ABCD          30          WKSTN 1          1     2
    ABCD          30          WKSTN 1          2     3
    ABCD          30          WKSTN 1          3     4
    A123          35          WKSTN 2          1     2
    A123          35          WKSTN 2          2     3
    A123          35          WKSTN 2          3     4
    B456          0          WKSTN 3          1     2
    B456          0          WKSTN 3          2     3
    B456          0          WKSTN 3          3     4
    ????          5          NULL          1     2
    ????          5          NULL          2     3
    ????          5          NULL          3     4I've tried a number of different things, googled my problem, and no luck yet...
    SELECT     t1.workstation
    ,     SUM(t1.my_value)
    ,     t2.wkstn_name
    ,     t3.my_nbr1
    ,     t3.my_nbr2
    FROM     my_tab1 t1
    ,     my_tab2 t2
    ,     my_tab3 t3
    ...So, what I want is a full outer join of t1 and t2 on workstation, and a cross-join of that with t3. I'm wondering if I can't find any examples of this online because it's not possible....
    Note: I'm stuck dealing with Oracle 8i
    Thanks!!

    Hi,
    The query I posted yesterday is a little more complicated than it needs to be.
    Since my_tab2.workstation is unique, there's no reason to do a separate sub-query like mt1; we can join my_tab1 to my_tab2 and get the SUM all in one sub-query.
    SELECT       foj.workstation
    ,       foj.sum_my_value
    ,       foj.wkstn_name
    ,       mt3.my_nbr1
    ,       mt3.my_nbr2
    FROM       (     -- Begin in-line view foj for full outer join
              SELECT        mt1.workstation
              ,        SUM (mt1.my_value)     AS sum_my_value
              ,        mt2.wkstn_name
              FROM        my_tab1   mt1
              ,        my_tab2   mt2
              WHERE        mt1.workstation     = mt2.workstation (+)
              GROUP BY   mt1.workstation
              ,        mt2.wkstn_name
                    UNION ALL
              SELECT      workstation
              ,      0      AS sum_my_value
              ,      wkstn_name
              FROM      my_tab2
              WHERE      workstation     NOT IN (     -- Begin NOT IN sub-query
                                               SELECT      workstation
                                       FROM      my_tab1
                                       WHERE      workstation     IS NOT NULL
                                     )     -- End NOT IN sub-query
           ) foj     -- End in-line view foj for full outer join
    ,       my_tab3  mt3
    ORDER BY  foj.wkstn_name
    ,       foj.workstation
    ,       mt3.my_nbr1
    ,       mt3.my_nbr2
    ;Thanks for posting the CREATE TABLE and INSERT statements, as well as the very clear desired results!
    user11033437 wrote:
    ... So, what I want is a full outer join of t1 and t2 on workstation, and a cross-join of that with t3. That it, exactly!
    The tricky part is how and when to get SUM (my_value). You might approach this by figuring out exactly what my_tab3 has to be cross-joined to; that is, exactly what should the result set of the full outer join between my_tab1 and my_tab2 look like. To do that, take your desired results, remove the columns that do not come from the full outer join, and remove the duplicate rows. You'll get:
    workstation     sum(my_value)     wkstn_name
    ABCD          30          WKSTN 1          
    A123          35          WKSTN 2          
    B456          0          WKSTN 3          
    ????          5          NULL          So the core of the problem is how to get these results from my_tab1 and my_tab2, which is done in sub-query foj above.
    I tried to use self-documenting names in my code. I hope you can understand it.
    I could spend hours explaining different parts of this query in more detail, but I'm sure I'd waste some of that time explaining things you already understand. If you want an explanation of somthing(s) specific, let me know.

  • OBIEE: non empty cross join function problem with some reports

    Hi all,
    I am getting some problem ,when we are excuting some requests in OBIEE its taking long time , Actually our OBIEE is connected with Essbase when we are generating some reports its taking long time so i captured the Query in OBIEE and Iam excuting that query in Essbase MDX editor
    its having the the function " NON EMPTy CROSS JOIN"
    which reports having non empty crossjoin function its taking long time so how can i disable this function in OBIEEfor that reports
    I dont want to use that function for my reports so how can i do this in OBIEE
    your help would be appriciated.
    Thanks
    Edited by: user8815661 on 26 mai 2010 08:44

    Any Help

  • How to resolve illegal cross join error

    Can someone please tell me how can we avoid illegal cross join error in modeling? If someone has any reference document , please share it.
    I have 5 tables - Dim (A, B , C,E) and Fact( D). C is lookup table which is used to resolve the lookup code column in table E.
    The relationships between these are
    A--< B--< E >--C
    & A--<D
    My requirement is i have to expose Attributes of A,B ,C & E within Dimension.
    These attributes (from B,C,E) will be treated as property of A.
    Someone may query these attributes without selecting any column from fact table.
    Thanks & Regards,
    Ashish

    Hi Ashish,
    it's not the first time you come up with this kind of question and I'm wondering if you understand the principle of granularity when I read your questions.
    On physical level, a fact table must always join with the lowest level of detail of your dimension table. Let me explain, by giving an example which looks like your situation.
    Assume I have three tables:
    Table "E" contains products, which has attributes like: product_id and product_name
    Table "B" contains order line items, which has attributes like: order_line_item_id, order_id and product_id.
    Table "A" contains orders, which has attributes like: order_id and customer_name.
    Table "D" contains facts ("metrical data") about my order: which has attributes like: order_id, order_revenue.
    This will be the diagram on physical level: E--<B--<A--<D
    Here are my joins: E.product_id on B.produc_id, B.order_id on A.order_id, A.order_id--<D.order_id
    Now, my question to you is: will I be able to get the revenue of a certain product?
    The answer is: No, because I don't know what part of my order is spent on a certain product. The problem is thus that the data in the fact table isn't stored on that level of detail, or in other words the fact and dimension table don't share the same level of granularity.
    How it should be:
    If you want to get the revenue per product, you will need to have a second fact table "G", which has data which is stored on order line item level. This table contains the following attributes: order_line_item_id, product_id and order_line_item_revenue.
    This will become your diagram on physical level:
    B--<G>--E
    Joins: B.order_line_item_id on G.order_line_item_id and E.product_id on G.product_id
    Table E has become a dimension of fact table G.
    The first physical diagram should look like this:
    A--<D
    If you want you can model both physical diagrams into one logical diagram, assuming that A and D (order dimension and fact table) are aggregates of B and G (order line items dimension and fact table). In that case you should read this blog item: http://obiee101.blogspot.com/2008/11/obiee-making-it-aggregate-aware.html
    Regards,
    Stijn

  • [nQSError: 14065] Illegal cross join

    I am getting the following the following error “[nQSError: 14065] Illegal cross join” in the following situation.
    We have one dimension table Called “WC_CUSTOMER_D” and in that table we are storing 2 row_wids one to store the “Status Wid” (data comes from WC_LOV_D) and “Risk Wid” (again data comes from WC_LOV_D) of the customer . We have 2 alias table as Dim_Status_WC_LOV_D and Dim_Risk_WC_LOV_D and it joins to the Dim_WC_CUSTOMER_D .
    In Logical we have one Logical table “Dim Customer” and has 3 Logical table source (reason is we can write content level filters ) for the each dimension tables. We exposed some attributes from the Dim_WC_CUSTOMER_D, Dim_status_WC_LOV_D and Dim_Risk_WC_LOV_D tables.
    In answer , We are getting the illegal cross join error when we expose fields from 2 WC_LOV_D alias tables
    Error comes only if we use alias of same physical type more than once
    Query Status: Query Failed: [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [
    WC_CUSTOMER_D T624599,
    WC_LOV_D T624699] with [
    WC_LOV_D T628734]
    But when I add a fact , BI is able to build a query
    select T624599.SOURCE_SYSTEM as c1,
    T624699.LOOKUP_CODE as c2,
    T628734.LOOKUP_CODE as c3,
    count(distinct T623979.CUST_ACCT_WID) as c4
    from
    WC_LOV_D T628734 /* Dim_Risk_WC_LOV_D_ */ ,
    WC_LOV_D T624699 /* Dim_Staus_WC_LOV_D */ ,
    WC_CUSTOMER_D T624599 /* Dim_W_CUSTOMER_D */ ,
    WC_CUSTOMER_F T623979 /* Fact_WC_CUSTOMER_F */
    where ( T623979.CUST_FIN_PROFL_WID = T624599.ROW_WID and T624599.X_ACCOUNT_STATUS_WID = T624699.ROW_WID and T624599.X_RISK_CODE_WID = T628734.ROW_WID and T628734.LOOKUP_TYPE = 'RISK' and T624699.LOOKUP_TYPE = 'STATUS' )
    group by T624599.X_ SOURCE_SYSTEM, T628734.LOOKUP_CODE, T624699.LOOKUP_CODE
    order by c1, c2, c3
    Please guide me if I did some mistake or any work around for this issue.
    Thanks
    Barna

    Hi,
    Maybe you have already resolved this issue. In any case, I found a solution following instructions in support note ID 1329237.1.
    Best regards,
    Cristina

  • [nQSError: 14065] Illegal cross join within the same dimension

    Hey guys,
    I'm stumped. I have two dimension tables that are joined 1:N (there is NOT an M:N relationship between them) and I have them joined in the Physical Layer and the Business Model and Mapping Layer. The two tables are F4101 (the "1") and F4102 (the "N") in the 1:N relationship. F4102 then joins to a fact table, and F4101 joins to NOTHING else. So I don't believe I have a circular condition or a need for a bridge table. Both tables are published to the Presentation Layer for reporting.
    The error occurs in Answers when I want to do something as trivial as display the three primary key columns together from F4101: F4101.col1, F4101.col2, F4101.col3 (all three make up the PK). When I do that, the following error occurs:
    "nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ F4101 T28761] with [ F4102 T1805] "
    What I can't figure out is WHY the F4102 table is listed in this error. I didn't try to report on it at all. See the logical SQL below from my query:
    "SQL Issued: SELECT "Item Master (F4101)".IMITM saw_0, "Item Master (F4101)".IMLITM saw_1, "Item Master (F4101)".IMAITM saw_2 FROM "Sales Analysis" ORDER BY saw_0, saw_1, saw_2"
    As soon as I take out one of the three PK columns and add in another non-PK column from F4101, it works just fine. And reporting on each of the three PK columns individually works as well in Answers.
    Any ideas? I would greatly appreciate it.
    Thanks.

    Try this;
    1. In the logical layer, create one folder called F4101_F4102.
    2. Map both F4101 and F4102 as logical table sources in that folder.
    3. Join from the folder F4101_F4102 to the fact using a Logical (new complex join) join.
    Chris.

  • Joining a dual query to another query

    dear all;
    I am using the following syntax to get a particular user_place from a table which is joined to dual...see syntax below
    select distinct ch.user_place from table_one inner join dual on
    ch.user_place = 'TEXAS';
    which give me the following results below
    User_place
    TEXAS
    now I would like to join this result to another query that gives me the following results below.
    syntax for query 2 is
    select t2.population_id, t2.male, t2.female from table_zone;
    results from query 2
    Population Male Female
    1000 60% 40%
    so that my final result will be
    user_place Population Male Female
    TEXAS 1000 60% 40%
    Hence, can this be done. if so, how can iI do it. Thank you.

    user13046875 wrote:
    dear all;
    I am using the following syntax to get a particular user_place from a table which is joined to dual...see syntax below
    select distinct ch.user_place from table_one inner join dual on
    ch.user_place = 'TEXAS';
    which give me the following results below
    User_place
    TEXASThere's no reason to use dual above; you can simply say:
    select distinct
         ch.user_place
    from      table_one
    where     ch.user_place     = 'TEXAS'
    now I would like to join this result to another query that gives me the following results below.
    syntax for query 2 is
    select t2.population_id, t2.male, t2.female from table_zone;
    results from query 2
    Population Male Female
    1000 60% 40%
    so that my final result will be
    user_place Population Male Female
    TEXAS 1000 60% 40%
    Hence, can this be done. if so, how can iI do it. Thank you.Sure; just cross join the two:
    select distinct
         ch.user_place
    ,     t2.population_id, t2.male, t2.female
    from           table_one
    cross join     table_zone
    where     ch.user_place     = 'TEXAS'
    ;This will get the specific results you want in this specific case.
    It may get the results you want in general, too, but I can't say for sure because I don't know what the general problem is. If you'd like help, describe what you're trying to do.

  • What's Preventing Query Folding in this Power Query?

    I've watched the Power Query presentation at the 2014 Tech Ed, and I'm trying to understand why this PQ (below) doesn't employ query folding.  The Tech Ed Power Point presentation states suggests that "Internal Power Query logic" affects folding,
    but I'm unclear what that means.  Are the Text functions inhibiting query folding?  If so, how might I "scrub" arguments in a custom function parameter list while still encouraging query folding?
    let
    Source = Teradata.Database("fsltdprd.am.freescale.net"),
    Product = Source{[Schema="EDW",Item="PROD_PDM_EFF_CURR"]}[Data],
    Prodline = Source{[Schema="EDW",Item="PROD_LN_PDM_DOC"]}[Data],
    ProdFilter = Table.SelectRows(Product,
    each [MTRL_TYPE_CD] = Text.Upper(Text.Trim("AA"))
    and Date.From([REVSN_RLSE_DTTM]) >= #date(2014,1,1)),
    PrdlFilter = Table.SelectRows(Prodline,
    each [TM_VAR_STS_FLG] = "A"
    and [EFF_TO_DT] = #date(3999,12,31)
    and Text.StartsWith([PTI_CD],Text.Upper(Text.Trim("J")))),
    ProdCols = Table.SelectColumns(ProdFilter,
    {"PART_ID","MTRL_TYPE_CD","PLC_CD","PAO_CD","REVSN_RLSE_DTTM","PROD_LN_ID"}),
    PrdlCols = Table.SelectColumns(PrdlFilter, {"DOC_ID","PTI_CD","PKG_CD"}),
    Join1 = Table.Join(ProdCols, {"PROD_LN_ID"}, PrdlCols, {"DOC_ID"}, JoinKind.Inner),
    Results = Table.RemoveColumns(Join1, {"DOC_ID"})
    in
    Results

    Btw, this is the "finished" product ... 
    (optional #"Pti 1 thru 4" as text
    , optional #"Mtrl Type" as text
    , optional #"Last Revision Dttm" as datetime) =>
    let
    Source = Teradata.Database("fsltdprd.am.freescale.net"),
    MtrlType = Text.Upper(Text.Trim(#"Mtrl Type")),
    PtiCode = Text.Upper(Text.Trim(#"Pti 1 thru 4")),
    LRevDttm = #"Last Revision Dttm",
    Product = Source{[Schema="EDW",Item="PROD_PDM_EFF_CURR"]}[Data],
    Prodline = Source{[Schema="EDW",Item="PROD_LN_PDM_DOC"]}[Data],
    ProdFilter = Table.SelectRows(Product,
    each (if MtrlType = null then true else [MTRL_TYPE_CD] = MtrlType )
    and (if LRevDttm = null then true else [REVSN_RLSE_DTTM] >= LRevDttm )),
    PrdlFilter = Table.SelectRows(Prodline,
    each [TM_VAR_STS_FLG] = "A"
    and [EFF_TO_DT] = #date(3999,12,31)
    and (if PtiCode = null then true else Text.StartsWith([PTI_CD], PtiCode ))),
    ProdCols = Table.SelectColumns(ProdFilter,
    {"PART_ID","MTRL_TYPE_CD","PLC_CD","PAO_CD","REVSN_RLSE_DTTM","PROD_LN_ID"}),
    PrdlCols = Table.SelectColumns(PrdlFilter, {"DOC_ID","PTI_CD","PKG_CD"}),
    Join1 = Table.Join(ProdCols, {"PROD_LN_ID"}, PrdlCols, {"DOC_ID"}, JoinKind.Inner),
    Results = Table.RemoveColumns(Join1, {"DOC_ID"})
    in
    Results

  • Fetch multiple rows using cross-join technique

    Hello.
    Can anyone suggest a method to return 3 rows from a query when only one row would otherwise be returned?
    I'm trying to achieve the Logical SQL analog to this -
    SELECT x.foo, p.id, p.name FROM people p CROSS JOIN (SELECT 1 AS foo UNION ALL SELECT 2 UNION ALL SELECT 3) x;Reason: I want to force a three (n) row result and use GROUP BY with case statements to create 3-level summary.
    Here is a simple Logical SQL expression that works for my OBI setup -
    SELECT
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number saw_0,
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".SR_Operating_Unit_Name saw_1
    FROM
         "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service"     
    WHERE
         ("- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number = '338246')But I think I cannot do this -
    SELECT
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number saw_0,
         "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".SR_Operating_Unit_Name saw_1
    FROM
         "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service"
         CROSS JOIN (SELECT 1 AS foo UNION ALL SELECT 2 UNION ALL SELECT 3)
    WHERE
         ("- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number = '338246')But what can I do?
    Thank you.
    -cs

    Hi CSeelig ,
    The BI Server uses the ANSI SQL standard. Then all SQL that follows this specification will in OBIEE work.
    I have made an example with a densification:
    http://gerardnico.com/wiki/dat/obiee/logical_sql/obiee_sql_densification
    You will see a cross join to make a densification.
    Cheers
    Nico

  • Difference between Innner Join and Cross Join

    Dear all,
    select * from tbl1 inner join tbl2 on tbl1.id =tbl2.id
    select * from tbl1 cross join tbl2 
    Works same what is the logical difference between this two statements??
    Dilip Patil..

    INNER Join returns the rows from  both tables which has satisfied matching condition.
    In
    CROSS Join, each record from tbl1 is matched with tbl2. Result would be Number Of rows in tbl1 X Number of rows in tbl2.
    Note: If you provide where condition in CROSS JOIN, it will give you same result as your first INNER JOIN query
    select * from tbl1 cross join tbl2 
    where tbl1.id =tbl2.id
    -Vaibhav Chaudhari

  • Formula :using filter with cross join issue

    Hi alll,
    Ihave one scenario like calclate the ytd values using cross join like
    IIF(is ([Flow].CurrentMember,[YTD]),
    (case
    when
    is ([PERIOD].CurrentMember,[2008.01])
    Then (Sum (crossjoin({[DI-3]},CrossJoin({[FLOW].[MtD]},{[PERIOD].[2008.01],[PERIOD].[2008.01] })))/2)
    when
    is ([PERIOD].CurrentMember,[2008.02])
    Then (Sum (crossjoin({[DI-3]},crossjoin({[FLOW].[MtD]},{[PERIOD].[2008.01],[PERIOD].[2008.02]}))))
    when
    is ([PERIOD].CurrentMember,[2008.03])
    Then (Sum (crossjoin({[DI-3]},CrossJoin({[FLOW].[MtD]},{[PERIOD].[2008.01],[PERIOD].[2008.02],[PERIOD].[2008.03]))))
    etc,othercase)
    but I am trying other oneto decrese the size of formula
    IIF(is ([Flow].CurrentMember,[YTD]),
    (Sum (crossjoin({[DI-3]},CrossJoin({[FLOW].[MtD]},
    {filter([PERIOD].Generations(5).members,StrToNum(Right([PERIOD].CurrentMember.MEMBER_NAME,2)) <= StrToNum(Right([PERIOD].CurrentMember.MEMBER_NAME,2)) AND StrToNum(Left([PERIOD].CurrentMember.MEMBER_NAME,4))=StrToNum(left([PERIOD].CurrentMember.MEMBER_NAME,4)) ) }))))
    , othercase )
    but its result is same value for all the YTDs for every month, something is going wrong some where
    plz any help would be appriociated
    Thanks in advance
    .

    macearl wrote:
    SQL View does not display unless data is returned by the query. Is that normal?
    Also, none of these options shows the literal result of the expression we built, i.e.:
    expression: CAST(YEAR(TIMESTAMPADD(SQL_TSI_MONTH, -24, CURRENT_DATE)) as CHAR)
    result: *2008*
    Having the ability to test expressions and see their results would be very helpful in debugging. If anyone knows how to do that please share!
    Thanks!
    MacOk, Probably shoud have figured this out before, but in response to my own question, the way to view the result of an expression is to add the expression as a column and include it in the Table Presentation.
    - Mac (he can be taught)

Maybe you are looking for

  • Is it possible to suppress the print dialog in Forms

    Hello, I would like to know if anybody here has some experience with printing from Forms. In my case, I want to give a Forms user opportunity to make a hardcopy e.g. to document Forms errors, to have a feedback for further development. I have a butto

  • Unable to run curl command from process c#

    Below is the curl command i am trying to run from c# script and i failed to execute please help curl -K config.cfg http://10.10.10.10:8080/MyApp/task string curlDirectory = "E:\\application"; string curlArg1 = " -K "; string curlArg2 = "config.cfg";

  • A few questions... Messenger and flash player

    okay guys yesterday i bought and ipod touch and i love it! i have the 2,0 software and app store! but can i get msn messenger or windows live messenger on my ipod touch? question number 2 i can watch videos directly from itunes when im connected to a

  • Cannot get Oracle 10g to start on a G5.  Floating point exception

    After a very painful 10g (EE) installation process i.e fixing all the following: 1) Created the missing /opt directory 2) Installation of XCode 1.2 3) Fixing the root.sh file 4) Downloaded the crstl file provided by Ron 5) Copied /etc/oratab/oratab t

  • Skin Softening Plug in

    I'm using CS4 Extended. I'm now getting busy enough with my photography on the side that softening the skin manually through layers is becoming rather time consuming. I'm curious if there is some kind of plug in that is able to speed up productivity