Cross join of dimensions
Hi,
For example: two dimension tables and one fact table.
dim1: branch
branch1
branch2
dim2: time
day1
day2
fact: sales
branch1, day2, 100
what I want in answers when using branch and time and sales without any filters:
Branch1, day1, 0
branch1, day 2, 100
Branch 2, day1, 0
Branch 2, day 2, 0
so basically I want to keep all dimensions combinations and related facts or 0 if there is no related facts. How to do it?
I know how to do it for just one dimension. That is to set up the relationship between the dimension and the fact as outer join. But how about two or more dimensions?
In SQL it will be something like dimension 1 cross join dimension 2 then left outer join the fact. How to do it in OBIEE 10 G?
And I have tried set branch - fact and time - fact as outer join. In answers,
1. select time and sales
day1, null
day2, 100
2. select branch and sales
branch1, 100
branch2, null
3. select branch, time , and sales
branch 1, day 2, 100
branch 2, null, null
Similar Messages
-
Cross join a dimension and measure
I am new to MDX, looking at this query, why item(0) in the cross join in the [Top Product Sales] returns just Internet Sales Amount? Isn't the cross join supposed to return a set of (Product, Internet Sales Amount)?
WITH
MEMBER [Measures].[Top Product Sales] AS
EXISTING
TopCount(
[Product].[Product].[Product].Members,
1,
([Measures].[Internet Sales Amount])
{[Measures].[Internet Sales Amount]}
}.Item(0)
,FORMAT_STRING="Currency"
SELECT
([Measures].[Internet Sales Amount]),
([Measures].[Top Product Sales])
} ON COLUMNS,
([Date].[Calendar Year].[CY 2005]),
([Date].[Calendar Year].[CY 2006]),
([Date].[Calendar Year].[CY 2007]),
([Date].[Calendar Year].[CY 2008])
} ON ROWS
FROM [Adventure Works]
If I run the following query, I get a set from both dimensions (product and Internet Sales Amount), which makes sense to me, but why the above cross join return only Internet Sales Amount?
WITH
set x AS
TopCount(
[Product].[Product].[Product].Members,
1,
([Measures].[Internet Sales Amount])
{[Measures].[Internet Sales Amount]}
SELECT
{} ON COLUMNS,
x ON ROWS
FROM [Adventure Works]Hi Thotwielder,
As you said that, the crossjoin return a set of (Product, Internet Sales Amount) which you can see on the screenshot below.
However, you use this set as a calculated measure, product is a dimension other than measure, so it will only use the Internet Sales Amount.
In your scenario, it seems that you want to get the top sales products for each year, right? If in this case, please try the query below.
SELECT
GENERATE
[Date].[Calendar].[Calendar Year].MEMBERS
,TOPCOUNT({[Date].[Calendar].CURRENTMEMBER*[Product].[Product].[Product]},1,[Measures].[Sales Amount]))
ON 1
,[Measures].[Sales Amount] ON 0
FROM [Adventure Works]
Results
If I have anything misunderstanding, please feel free to let me know.
Regards,
Charlie Liao
TechNet Community Support -
Illegal cross join within the same dimension caused by incorrect subject ar
hi!
Imagine the following BMM:
There is one Logical Dimension Table "Service Account" with the following LTS:
- LTS "D_SERVICE"
- LTS "D_SERVICE_CLASS"
- LTS "D_SERVICE_STATUS"
This Logical Tabe "Service Account" joins (One-to-many) with several Fact Tables (other Logical Tables).
In the Physical Layer the joins for the "Service Account" LTS are:
- One-to-many between D_SERVICE_CLASS and D_SERVICE
- One-to-many between D_SERVICE_STATUS and D_SERVICE
The problem is that when I build a report in Answers using only the following columns of the Logical Table "Service Account":
- Service Class Desc (which exists in the Logical Table "Service Account" and in the Physical Table D_SERVICE_CLASS)
- Service Status Desc (which exists in the Logical Table "Service Account" and in the Physical Tabl D_SERVICE_STATUS)
- MSISDN (which existis in the Logical Table "Service Account" and in the Phsyical Table D_SERVICE)
the following error appears:
Estado: HY000. Código: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ (select * from prd.D_SERVICE where SOURCE_SYS in ('ARBOR','PPB') and DW_SERV_ST_ID in (100000003,100000009)) as T1836, D_SERVICE_CLASS T1916] with [ D_SERVICE_STATUS T1948] (HY000)
SQL emitido: SELECT "SERVICE ACCOUNT"."TLC MSISDN9" saw_0, "SERVICE ACCOUNT"."IWS Service Class Desc" saw_1, "SERVICE ACCOUNT"."TLC Service Status Desc" saw_2 FROM "VFPT - Upgrade Siebel" WHERE "SERVICE ACCOUNT"."TLC MSISDN9" = '917330340' ORDER BY saw_0, saw_1, saw_2
Help, please!
Thanks.Physically, only D_SERVICE is joined to the facts. Then D_SERVICE_CLASS is joined to D_SERVICE (one-to-many) and D_SERVICE_STATUS is joined also to D_SERVICE (one-to-many).
In the BMM, there is only one Logical Dimension Table for those 3 physical tables. This Logical Dimension Table is called "Service Account" and has 3 LTS: D_SERVICE, D_SERVICE_CLASS, D_SERVICE_STATUS. The Logical Dimension Table has several logical columns that are associated to those 3 LTS: SERVICE_KEY, SERVICE_CLASS_KEY, SERVICE_STATUS_KEY, SERVICE_MSISDN, SERVICE_CLASS_DESC, SERVICE_STATUS_DESC.
The Logical Dimension Table "Service Account" is then joined to a fact table (one-to-many).
I didn't understand the suggestion about the 3 LTS... Aren't we doing that already? Can you explain it better, please?
thanks. -
[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. -
Getting Error : Illegal cross join within the same dimension
Hi All,
At database there are 4 tables - XLE_Entity_profiles (A) , XLE_ETB_profiles (B) ,XLE_Registration (C),XLE_Reg_Function(D) .
Attribute info is as below -
A.Le_name
B.LRU_name
C. Registraton name
D. Function_code
I have to model a single dimension which contains the attributes from these tables and dimension should also support queries which contains attributes from this dimension only without selecting any fact.
For Exp - query is as below -
Le_name,Le-Registraton name,Le_Function_code,LRU_name,LRU_Registraton name,LRU_Function_code
To support such query , i created aliases of table XLE_Registration,XLE_Reg_Function.
Aliases names are - XLE_Registration_LE (E),XLE_Registration_LRU (F),XLE_Reg_Function_LE (G).,XLE_Reg_Function_LRU (H)
Attributes from aliases are as below -
XLE_Registration_LE- Le-Registraton name
XLE_Registration_LRU -LRU_Registraton name
XLE_Reg_Function_LE - Le_Function_code
XLE_Reg_Function_LRU - LRU_Function_code
i have renamed the attributes For LE and LRU.
The Physical layer diagram is as below
A < B
E F
G H
[A:B (1:M) , A:E(1:M), E:G(1:M),B:F(1:M),F:H(1:M)]
At logical layer , i have created a dimension DIM-LE with below logical table sources -
A ,B,E,F,G,H
Using the properties of LTS B , i mapped B to A.
Using the properties of LTS E , i mapped E to A.
Using the properties of LTS F , i mapped F to B.
Using the properties of LTS G , i mapped G to E.
Using the properties of LTS H , i mapped H to F.
Now when i run the query , i am getting the error -
Query - Le_name,Le-Registraton name,Le_Function_code,LRU_name,LRU_Registraton name,LRU_Function_code
+++Administrator:2a0000:2a0004:----2008/11/07 19:39:03
Query Status: Query Failed: [nQSError: 14065|http://forums.oracle.com/forums/] Illegal cross join within the same dimension caused by incorrect subject area setup: [
XLE_REGISTRATIONS T1218 On XLE_REGISTRATIONS_LRU.REGISTRATION_ID = XLE_REG_FUNCTIONS_LRU.REGISTRATION_ID,
XLE_REG_FUNCTIONS T5737,
XLE_ETB_PROFILES T900 On XLE_ETB_PROFILES.ESTABLISHMENT_ID = XLE_REGISTRATIONS_LRU.SOURCE_ID,
XLE_ENTITY_PROFILES T836 On XLE_ENTITY_PROFILES.LEGAL_ENTITY_ID = XLE_ETB_PROFILES.LEGAL_ENTITY_ID] with [
XLE_REGISTRATIONS T1155 On XLE_REGISTRATIONS_LE.REGISTRATION_ID = XLE_REG_FUNCTIONS_LE.REGISTRATION_ID,
XLE_REG_FUNCTIONS T5703,
XLE_ENTITY_PROFILES T836 On XLE_ENTITY_PROFILES.LEGAL_ENTITY_ID = XLE_REGISTRATIONS_LE.SOURCE_ID]
But when i run below query,which resembles the BI Answer query, against the database ,
select distinct A.NAME as c1,
B.REGISTERED_NAME as c2,
E.Function_code as c5,
C.NAME as c3,
D.REGISTERED_NAME as c4,
F.Function_code as c6
from
XLE_ENTITY_PROFILES A,
XLE_REGISTRATIONS B,
XLE_REG_FUNCTIONS E,
XLE_ETB_PROFILES C,
XLE_REGISTRATIONS D,
XLE_REG_FUNCTIONS F
where (A.LEGAL_ENTITY_ID = C.LEGAL_ENTITY_ID and
A.LEGAL_ENTITY_ID = B.SOURCE_ID and
C.ESTABLISHMENT_ID = D.SOURCE_ID and
B.SOURCE_TABLE = 'XLE_ENTITY_PROFILES' and
D.SOURCE_TABLE = 'XLE_ETB_PROFILES' and
E.Registration_id = B.Registration_id and
F.Registration_id = D.Registration_id)
order by c1, c2,c5, c3, c4,c6
i don't get any error.
Please let me know , why am i getting this error and how can i resolve this issue?Hi All,
Is there any update on this ?
Thanks,Ashish -
Illegal cross join within the same dimension caused by incorrect subject.
Hello Gurus,
I am getting this error for one calculated column in OBIEE 11G
Illegal cross join within the same dimension caused by incorrect subject area setup. *[ WC_PC_POSITION_D AS Dim_WC_PC_POSITION_D] with [ W_GL_ACCOUNT_D AS Dim_W_GL_ACCOUNT_D On Dim_W_GL_ACCOUNT_D.ROW_WID = Fact_WC_PC_BUDGET_DTLS_F.GL_ACCOUNT_WID, WC_PC_BUDGET_DTLS_F AS Fact_WC_PC_BUDGET_DTLS_F] (HY000)*
the same column is calculated in OBIEE 10G and it's giving fine result.
the way it's calculated in BMM is we are using 2 different logical table's column for deriving new column.
is anyone having any idea?
Thanking You..More Specially,
Physical Layer:
Dim:View1,View2,View3,View4
Fact:View5
all Views are PK joined in Phsical layer.
So I need all columns in 3 Views and few column in View4.
In BMM :
Dim:View1,View2,View3
Fact:View 5
are joined and created LTS in View3 for LTS View4 and dropped few coulmns and mapped the columns.
In reports,
If I pull the columns from View3 which is came from view4 then getting the error.
I hope does it make sense.
Please help on this. -
Illegal cross join within the same dimension
Hi,
When certain fields are selected within the presentation table an "illegal cross join" error is returned by the BI Server. However if a FACT is added from one of the other presentation tables the "illegal cross join" error goes away. we need to query without fact column.
We are getting following error
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ CALL_CENTER.COUNSELOR_MANAGER T782130] with [ CALL_CENTER.COUNSELOR_HR T781594 On CALL_CENTER.COUNSELOR_HR.MASTER_STAFF_COUNSELOR_ID = CALL_CENTER.MASTER_STAFF_COUNSELOR.MASTER_STAFF_COUNSELOR_ID, CALL_CENTER.MASTER_STAFF_COUNSELOR T781739] (HY000)
Can anybody help me solving this issue.
Thanks,
KS.Please give us an example of what you need.
OBIEE perform a query in the dimension or through the fact table.
You can't join two dimensions in the repository without going through a fact table.
If you need to query without fact column, it's because you have design two dimensions where
normally you can do one.
You have then two solutions :
* change the design of your logical model to make only one dimension.
* use the OBIEE logical SQL in answer.
http://gerardnico.com/wiki/dat/obiee/bi_server/design/obiee_logical_sql
Success
Nico -
Illegal cross join within the same dimension caused by incorrect
Hi,
I created a logical table from 2 different Physical tables. Then I created a Dimension out of this logical table.
At the BI Answer, while I tried drilling on the dimension, I get the following error:
“Illegal cross join within the same dimension caused by incorrect subject area setup “
Please let me know if there is any work around this issue.
Thanks,I think that OBIEE try to do a cross join but don't allow it
http://gerardnico.com/wiki/dw/join/cross_join
It generate surely a join with two tables where you don't have any condition or relation in the physical layer.
When you check the column from the subject area are you sure that you have a condition in the physical layer for the two tables ?
When you say "I tried drilling on the dimension", does it means that you have a report and when you click on link which come from a dimension level, it doesn't work ?
Regards
Nico -
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,
AshishHi 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
BarnaHi,
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 -
HI,
i use OBIEE version 11.1.1.6.0. I created dummy fact table and column in physical layer. and join all dimensional table with this fact. but i dont know ow handle with it in business model. can anyone help me to create cross join?
Thanks
Edited by: 968086 on Oct 30, 2012 12:59 AMFollow this link
http://www.rittmanmead.com/2009/08/oracle-bi-ee-10-1-3-4-1-reporting-on-non-transactional-dimension-values-equivalence-of-outer-joins/
Pls mark if helps -
I have 2 separate data providers/queries
Let's say in the first one it returns something like this:
OrderId Product Amount
1 Apple 500
1 Orange 400
1 Banana 600
2 Apple 300
2 Orange 200
And in the second one it returns something like this:
OrderId SalesPerson
1 Bob
1 Mary
2 Steve
I'd like to have the webi report output something like this (basically a cross join)
OrderId Product Amount SalesPerson
1 Apple 500 Bob
1 Orange 400 Bob
1 Banana 600 Bob
1 Apple 500 Mary
1 Orange 400 Mary
1 Banana 600 Mary
2 Apple 300 Steve
2 Orange 200 Steve
I think I've tried every combination of merge dimensions/detail objects, etc. but always end up with either #INCOMPATIBLE or #MULTIVALUE in SalesPerson when there are multiple salespersons associated with an order (such as order 1 in the example above). When there is only one SalesPerson associated with the order then it works as expected, such as below:
OrderId Product Amount SalesPerson
1 Apple 500 #MUTLIVALUE
1 Orange 400 #MULTIVALUE
1 Banana 600 #MULTIVALUE
2 Apple 300 Steve
2 Orange 200 Steve
I can't really change the universe, so is this possible to do within webi?Thanks Bala, but I should have mentioned in my original post I tried that as well. It gives me something like this:
OrderId Product Amount SalesPerson
1 Apple 500 Bob
1 Orange 400 Bob
1 Banana 600 Mary
2 Apple 300 Steve
2 Orange 200 Steve
It avoids the #MULTIVALUE, but it doesn't do a proper cross-join. It shows only the number of rows associated with the Product, but doesn't cross-join across SalesPerson. Worse, it seems to "randomly" join against SalesPerson for one of the rows - i.e, I'm not sure why it displayed Mary for one of the rows instead of Bob. -
Cross Join or Cartesian Product
Hi Expert,
I'm not sure if I'm posting in the right place, because this problem involve between BW/BEx, Universe and BO; but I think there's a possibility 'a wrong' in the universe.
Right now I want to create a report in Webi from BEx Query via Universe.
When I put 2 query item in Webi, let's say, PERNR and TRFST. The result looks like this (example) :
PERNR TRFST
12345 S1
12345 S2
54321 S1
54321 S2
Ok, that's the appetizer. Here's the main course.
For some reason, I'm using function module in ABAB to create a data source table as transaction data in BW. I create a Fact Table that contain all field that I need to create dimension tables. This, in my opinion, for eliminate the possibility that the cross join appear because there's something wrong in the relationship between the dimension and the fact when creating the cube. This is a little example of my Cube result :
PERNR TRFST KEY FIGURE
12345 S1 XXX
54321 S2 ZZZ
As I explain above, I create Person dimension and TRFST (in my case I called 'Eselon') dimension and 1 Key Figure. So, from here, I assumed that there's no problem with the BW because the cube resulted the content as I'm expected.
Then I moved to BEx designer. I create a query from that cube, creating a pivot table that contain Person, Eselon, and the key figure. When I open the query in the BEx Analysis, the excel create a pivot table like this :
KEY FIGURE
12345 S1 XXX
Result XXX
54321 S2 ZZZ
Result ZZZ
From here, again I assumed, there's no problem in BEx, since there's no cross join between the dimension. Then I create the universe, then I tried to create the Webi report, and DANG!! a cross join appear.
Did you guys have any idea or solution about this? This is for the first time I created a universe using BEx, so maybe I miss something.
I will appreciate every helpful comment from you
Thank You
RullyWell.. ummm.. actually I don't using 2 query nor 2 data provider for my report. It came from 1 query. But that's ok. It's just misunderstanding between us. Maybe because I'm using the '2 query item' word. I'm sorry.
Just for your information, finally I can solve it. Like I said in the first post, I'm just trying to use 2 characteristic (I think this is better word rather than query item), but I don't pull the key figures to the report. When I put at least 1 key figure to the report, pam pam pa ra pam... the cross join gone. I don't know why, but it happen.
Than, I examine this case by creating a simple report using eFashion universe. When I put 2 characteristic without key figure, there's no cross join. I don't know why, but it happen.
well, thank you for your comment, even mostly there are misunderstanding, but I really appreciate it. Thank you.
Rully -
Cross Join in SAP MDX using Web I
Hi there,
I am facing an issue. I am currently using BO universe on the top of BW infocube. Now whenever i am dragging two dimensions from the universe in my web i report it is creating cross join , however whenever i add any key figures , it changes the cross join to Non Empty Cross Join.
Now while testing the mdx query in MDXTEST i found that while running the MDX query with two dimensions only is giving me a cross join in MDXTEST also, however if i modify the cross join to non empty cross join it gives me the correct data.
Is it possible to do something in BO or SAP side so that my query starts creating non empty cross join rather then mere cross join.
Is it something to do with the transports we run before installing SAP integration kit
Thanks for your supportThanks for your input Ingo. I am however creating a report in web intelligence using infocube as the base. Connected via integration kit and a universe. The universe is on the top of the infocube.
So when i create a web i report with two dimensions it is simply doing cross join however when we add a key figure it gives the correct data. The data which comes out of a report with two dimensions only is different then the data coming out of a bex query using the infocube as the base simply because the web i report is creating cross join (in database terminology) whereas the bex query is joining the two dimensions via the fact table to give us relevant data ( e.g. customers for a particular material)
Now when we analyzed the query coming out web i, we found out that instead of "crossjoin" if it uses "Non Empty Crossjoin" it solves the purpose.
Coming to the point the query getting generated from web i is incorrect. I was hoping to get some kind of fix if available from the forum else ask the SAP support people to provide with a hotfix or something
Thanks -
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.
Maybe you are looking for
-
Input must bein module pool and the output should be in ALV report
Dear Friends, Greetings..................... Please give me solution for my problem. Consider there is one module pool screen with the fields empno, edob, ecity.There is one search button.if the user clicks the search button.it should display the emp
-
Hi All one of my query is taking too much time and really appreciate that if you people guide me how to get it fast. I'm using Oracle 11g Enterprise Release 11.2.0.2.0 64 bit version. My query is below and this query extract around 1 million records.
-
I am having trouble with my managers in release 12.1.1. I am running a fresh install. After running adcmctl.sh start the internal manager 'seems' to stay up for a few seconds (I see it coming up in the sysadmin --> concurrent --> manager --> administ
-
XML document selection with internet explorer IE 6
I am running teststand 4, with labview 8.2.1 and the IE version is 6.0.2900.2180 I try selecting the xml document as a report type and it keeps telling me i need IE6. This didn't occur with teststand 3.5. Do i need to do something or do i actually ne
-
In Help Menu it says HELP isn't available regardless of what app I'm using
Trying to get some simple answers using the Help search box in the menu bar. In Safari, mail etc. it just says 'Help isn't available' after entering info. Where's my help?