Two tables with different filter values base on a analysis
Hi guys,
let assume that I have a analysis with columns : group_id and sales.
Based on it I would like to create two tables : table1 where group_id =1 and table2 where group_id = 2.
Is OBIEE capable of doing it?
Regards,
Slavi
Hi Slavi,
You can do that in single analysis, but you need to have the group_id column two times.
That is, bring group_id_1, group_id_2 (same column), sales
Now in table 1,
bring group_id_1, sales
Then in selection steps for group_id_1 -> Select Members -> Action choose keep only -> choose the filter value 1
This will filter the table 1 with group_id 1
In table2 bring group_id_2, sales
Then do the same step for group_id_2 with value 2.
now in same report you have two reports with different filter.
If you want you can keep the same column name for both group_id columns, I just kept group_id_1, group_id_2 for easy reference.
Similar Messages
-
How to compare two rows from two table with different data
how to compare two rows from two table with different data
e.g.
Table 1
ID DESC
1 aaa
2 bbb
3 ccc
Table 2
ID DESC
1 aaa
2 xxx
3 ccc
Result
2Create
table tab1(ID
int ,DE char(10))
Create
table tab2(ID
int ,DE char(10))
Insert
into tab1 Values
(1,'aaa')
Insert
into tab1 Values
(2,'bbb')
Insert
into tab1 Values(3,'ccc')
Insert
into tab1 Values(4,'dfe')
Insert
into tab2 Values
(1,'aaa')
Insert
into tab2 Values
(2,'xx')
Insert
into tab2 Values(3,'ccc')
Insert
into tab2 Values(6,'wdr')
SELECT
tab1.ID,tab2.ID
As T2 from tab1
FULL
join tab2 on tab1.ID
= tab2.ID
WHERE
BINARY_CHECKSUM(tab1.ID,tab1.DE)
<> BINARY_CHECKSUM(tab2.ID,tab2.DE)
OR tab1.ID
IS NULL
OR
tab2.ID IS
NULL
ID column considered as a primary Key
Apart from different record,Above query populate missing record in both tables.
Result Set
ID ID
2 2
4 NULL
NULL 6
ganeshk -
How to join two columns between two tables with different column names
Hi
How i can join 2 columns with different names between the 2 tables.
Can any one please give solution for this.
Thanks
ManuHi,
basic understanding of joins:
If you want to join 2 tables there should be matching column w.r.t. data and it's data type. You need not to have same column names in both the tables...
so, find those columns which has got same values.. -
Comparing Data between two tables with different structure
Hi,
I have 2 tables T1 and T2. Both tables have different structure. I have to check for rows missing in T1 which exist in T2 and vice-versa. I can do that using MINUS operator. But the part where the data exists in both T1 and T2, I have to compare some columns (9 columns the names of this column coming from a meta-data table) if they have same values. If not an exception has to be generated.
Any help is appreciated.
ThanksHi,
Whenever you need help on this forum, post:
(1) The version of Oracle (and any other relevant software) you're using
(2) A little sample data (just enough to show what the problem is) from all the relevant tables
(3) The results you want from that data (4) Your best attempt so far
Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
Formatted tabular output is okay for (3). Type before and after the tabular text, to preserve spacing.
What do you mean by "an exception has to be generated"?
Do you want to raise an error?
Do you want something to appear in the result set?
MINUS finds rows that are in one result set, but not in another.
INTERSECT finds rows that are in both result sets.
Column names have to be hard-coded into the SQL statement. If you want to write something now that will get column names from a metadata table sometime in the future, then you have to use dynamic SQL. SQL*Plus sometimes has quick and dirty ways of doing dynamic SQL, so say whether you're using SQL*Plus or not. -
Joining two tables with different DB
Hi
We have 2 sources DB2 and Oracle.
In DB2 we have two tables which stores.
Tbl1
Case_no Information1 Information2 Information3
11112 sddf asd null null
11113 asd asd null null
Tbl2
Inf Info1 Code Info3
Xedy Asdf 111 afder
Mad Tag 123 top
The above tables are complex join with this condition
Tbl1.case_no=Tbl1.case_no.
Oracle tbl
Code Code_desc
111 Very good
123 bad
My requirement is to join the tbl2 with Oracle tbl. Based on the codes in DB2 table I should display the Code_desc in my reports. Like this
Case_no Code Code_desc
11112 111 Very good
11113 123 bad
But I am getting the Cartesian result.
Case_no Code Code_desc
11112 111 Very good
11112 123 bad
11113 111 Very good
11113 123 bad
Please help to resolve.
Regards
MDSelect Oracletbl and tbl2, right click on them open physical diagram, selected objects. In the physical diagram page Create a join between Oracletbl and tbl2 with the condition code=code.
In business model create a complex join between these two. Now reload metadata/restart services check output.
Let me know if this does not work you. -
Copying data between two tables with different structures
I have two tables. second table has three extra fields at the end. How can I copy data from first table to the other? I tried the following but it does not seem to work:
INSERT INTO second_table ((select * from first_table),'text','text',5)
Please help. ThanksINSERT INTO second_table SELECT col1, col2, col3, .., 'text', 'text', 5 FROM first_table;
Cheers!
r@m@ -
Report over two tables with shuttle seperated values listed per row
Hy,
I have created an application with 3 Tables: products (P_ID), applications(A_ID), crosstable (ID, A_ID, P_ID) for the assignment.
In the app it´s possible to define the involved products for each application.
Now I need a summary page, where all involved products, for each application are listed.
My problem is, the table application (column:products) includes only tangent product PK, seperated by comma as a result of a shuttle field.
For the summary report i need all app informations incl. product real names, correctly listed, each in a row.
Exists a simple chance without BI-Publisher to create this report, maybe with decode or similar.
Thanks TomHello,
Did you already have a look at apex_util.string_to_table (and table_to_string)?
I guess that could help you.
An example is here: Using Shuttles and multiple values.
Regards,
Dimitri
-- http://dgielis.blogspot.com/
-- http://www.apex-evangelists.com/
-- http://www.apexblogs.info/ -
Performance between two partitionned tables with different structure
Hi,
I would like if there is a difference between two partitionned tables with different structure in term of performance (access, query, insertions, updates ).
I explain myself in detail :
I have a table that stores one value every 10 minutes in a day (so we have 144 values (24*6) in the whole day), with the corresponding id.
Here is the structure :
| Table T1 |
+ id PK |
+ date PK |
+ sample1 |
+ sample2 |
+ ... |
+ sample144 |
The table is partionned on the column date, with a partionned every months. The primary key is based on the columns (id, date).
There is an additionnal index on the column (id) (is it useful ?).
I would like to know if it is better to have a table with just (id, date, value) , so for one row in the first table we'll have 144 rows in the future? table. The partition will already be on the columns (id, date) with the index associated.
What are the gains or loss in performance with this new structure ( access, DMLs , storage ) ?
I discuss with the Java developers and they say it is simpler to manage in their code.
Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
Thanks & Regards
From France
Oliver
Edited by: 998239 on 5 avr. 2013 01:59I mean storage in tablespaces and datafiles on disk.
Can you justify please and give me concrete arguments why the two structures are equivalent ( except inserting data in T(id, date,value))
because i have to make a report.i didnt say any thing like
two structures are equivalent ( except inserting data in T(id, date,value)i said
About structure : TABLE1(id, date, value) is better than TABLE1(id, date, sample1, .... sample144)because
1) oracle has restriction for numbers of column. Ok you can have 144 columns now but for future if you must have more than 1000 columns , what will you do?
2) Restrictions on Table Compression (Table compression is not supported for tables with more than 255 columns.)
3) store same type values on diffrent columns is bad practise
http://docs.oracle.com/cd/B28359_01/server.111/b28318/schema.htm#i4383
i remember i seen Toms article about this but now i cant find it sorry ((( if i found i will post here -
Joining two fact tables with different dimensions into single logical table
Hi Gurus,
I try to accomplish in Oracle Business Intelligence 11.1.1.3.0:
F1 (D1, D2 and D3)
F2 (D1 and D2 and D4)
And we want to build a report F1 F2 D1 D2 D3 D4 to have data for:
F1 that match only for D1-D2-D3
and data for
F2 that match only D1-D2-D4
all that in one row, so D3 and D4 are not common dimensions.
I can only do:
F3 (D1, D2)
F4 (D1, D2 and D4)
And report
F3 F4 D1,D2,D4 (all that in one row, and only D4 is not a common dimension)
Here is the very good example how to accomplish the scenario 1
http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
But looks like it does not work in 11.1.1.3.0
I get
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 14025] No fact table exists at the requested level of detail: [,,Clients,,Day,ROI,,,,EW_Names,,,,,,,,,,,,,,,,,]. (HY000)
I am sure I set up everything correctly as advised in the blog but it works with only one not a common dimension
Is it a bug in 11.1.1.3.0 or something?
Thanks,
KateThanks for all your replies.
Actually, I've tried the solutions you guys mentioned. Generally speaking, the result should be displayed. However, my scenario is a little bit tricky.
table Y's figures are not the aggregation of table X for D dimension. Instead, table Y's figures include not only D dimension total, but also others (others do not mean A, B, C dimension). For example, table Y stores all food's figure, while table X stores only drink's figure. D dimension is only about drink's detail. In my scenario, other foods' figure is not provided.
So, even if I set D dimension to all/total for table X, table X's result is still not the same as table Y.
Indeed, table Y does not have a column key to join to D dimension's key. So, if I select D dimension and table Y's measures at the same time in BI Answer, result returns no data. Hence, I can't compare table X and table Y's results with selection of D dimension.
Is there any solution to solve this problem?
Edited by: TomChan on Jun 3, 2009 9:36 AM -
Revision: 13716
Revision: 13716
Author: [email protected]
Date: 2010-01-22 09:26:12 -0800 (Fri, 22 Jan 2010)
Log Message:
since include-read-only is a server global setting, we can't have two channels with different value. remove the test for the include-read-only false. update the service-config.xml as well.
Modified Paths:
blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/services-config.mods.xml
blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/remotingService/dataTypes/ReadOn lyTest.mxmlYou can give this a try on your Ultimate machine. While these are said to be for Vista, I used it on my Win 7 machine just fine and it fixed the problems I was having. Hope it works for you.
The problem is that Vista, by default, will only use NTLMv2 for authentication, which is not supported by Mac OS X's Windows Sharing service.
The other problem is the Minimum Session Security for NTVLM SSP based Clients.
To get around this:
1. In Vista, open the Control Panel
2. Switch to "Classic" view
3. Double-click Administration Tools
4. Double-click Local Security Policy
5. Or Secpol.msc
6. Expand "Local Policies" and select "Security Options"
7. Alternate : Type secpol.msc to get editor up then
8. Locate "Network Security: LAN Manager Authentication Level" in the list and double-click it.
9. Change the setting from "Send NTMLv2 response only" to "Send LM & NTLM - use NTLMv2 session if negotiated"
10. Network Security: Minimum session security for NTLM SSP Based (including secure RPC) Clients
11. Change the setting from "require 128 bit" to unchecked (No Minimum)
12. Click OK
the real difference between vista and windows 7 procedure is 10 and 11 -
How to match columns of two tables with
Hello:
I've two tables like below:
Table1:(Base Table)
Country|Prefix|Prefix_Length
CountryA|001|3
CountryB|0012|4
CountryC|00443|5
CountryD|0091|4
Table2:(Detail Table)
Population|Area|Prefix
500|AreaA|0015921
1000|AreaB|00122
400|AreaC|00443743
300|AreaD|0091333
100|AreaA|001
I need to match these two tables with prefix column (which length is not fixed in both tables: but it starts with 00 in both tables). Two different countries prefix can be similar up to a certain length. So, Prefix_Length can be used to determine (exactly) how long should be taken to search from Table2.
Output:
Country|Prefix|Area|Population
CountryA|001|AreaA|600
CountryB|0012|AreaB|1000
CountryC|00443|AreaC|400
CountryD|0091|AreaD|300
Please help me with your valuable feedback.
-TanvirYou have to explain how CountryA population is calculated:
with base_table as (
select 'CountryA' country,'001' prefix,3 prefix_length from dual union all
select 'CountryB','0012',4 from dual union all
select 'CountryC','00443',5 from dual union all
select 'CountryD','0091',4 from dual
detail_table as (
select 500 population,'AreaA' area,'0015921' prefix from dual union all
select 1000,'AreaB','00122' from dual union all
select 400,'AreaC','00443743' from dual union all
select 300,'AreaD','0091333' from dual union all
select 100,'AreaA','001' from dual
-- end of on-the-fly data sample
select country,
b.prefix,
area,
population
from base_table b,
detail_table d
where b.prefix = substr(d.prefix,1,prefix_length)
COUNTRY PREFI AREA POPULATION
CountryA 001 AreaA 500
CountryA 001 AreaB 1000
CountryA 001 AreaA 100
CountryB 0012 AreaB 1000
CountryC 00443 AreaC 400
CountryD 0091 AreaD 300
6 rows selected.
SQL> SY. -
How do you join two tables from different Oracle schemas using a subquery
I am trying to join two tables from different Oracle schemas using a subquery. I can extract data from each of the tables without a problem. However, when I combine the select statements using a subquery I get the Oracle error *'ORA-00936: missing expression'*. Since each SELECT statement executes on its own without error I don't understand what is missing. The result set I am trying to get is to match up the LINE_ID from PDTABLE_12_1 in schema DD_12809 with the MAT_DESCRIPTION from table PDTABLE_201 in schema RA_12809.
The query is as follows:
sql = "SELECT [DD_12809].[PDTABLE_12_1].LINE_ID FROM [DD_12809].[PDTABLE_12_1] JOIN " _
+ "(SELECT [RA_12809].[PDTABLE_201].MAT_DESCRIPTION " _
+ "FROM [RA_12809].[PDTABLE_201]) AS FAB " _
+ "ON [DD_12809].[PDTABLE_12_1].PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS"
The format of the query is copied from a SQL programming manual.
I also tried executing the query using a straight JOIN on the two tables but got the same results. Any insight would be helpful. Thanks!
Edited by: user11338343 on Oct 19, 2009 6:55 AMI believe you are receiving the error because you are trying to JOIN on a column that doesn't exist. For example you are trying to join on FAB.PIPING_MATER_CLASS but that column does not exist in the subquery.
If you want to do a straight join without a subquery you could do the following
SELECT DD_12809.PDTABLE_12_1.LINE_ID
, FAB.MAT_DESCRIPTION
FROM DD_12809.PDTABLE_12_1
JOIN RA_12809.PDTABLE_201 AS FAB ON DD_12809.PDTABLE_12_1.PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS HTH! -
MATERIALIZED view on two tables with Fast Refresh
i Wanted to create MV on two tables with Fast refresh on commit.
I followed below steps
create materialized view log on t1 WITH PRIMARY KEY, rowid;
create materialized view log on t2 WITH PRIMARY KEY, rowid;
CREATE MATERIALIZED VIEW ETL_ENTITY_DIVISION_ASSO_MV
REFRESH fast ON commit
ENABLE QUERY REWRITE
AS
select A.ROWID B.ROWID,a.c1, DECODE(a.c1,'aaa','xxx','aaa') c2
from t1 A
join t2 b
on AB.c1= CD.c2;
i am getting below error.
Error report:
SQL Error: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
*Cause: The materialized view did not satisfy conditions for refresh at
commit time.
*Action: Specify only valid options.
Basically i want to take record in MV by joinig two tables and if both of the base tables will updated then record should reflect in materialised view.
Please do the needfull.does the table support PCT? the other restrictions on joins look to be ok in your statement.
maybe try creating first with on demand instead of commit to see does it create.
http://docs.oracle.com/cd/B19306_01/server.102/b14223/basicmv.htm
>
Materialized Views Containing Only Joins
Some materialized views contain only joins and no aggregates, such as in Example 8-4, where a materialized view is created that joins the sales table to the times and customers tables. The advantage of creating this type of materialized view is that expensive joins will be precalculated.
Fast refresh for a materialized view containing only joins is possible after any type of DML to the base tables (direct-path or conventional INSERT, UPDATE, or DELETE).
A materialized view containing only joins can be defined to be refreshed ON COMMIT or ON DEMAND. If it is ON COMMIT, the refresh is performed at commit time of the transaction that does DML on the materialized view's detail table.
If you specify REFRESH FAST, Oracle performs further verification of the query definition to ensure that fast refresh can be performed if any of the detail tables change. These additional checks are:
A materialized view log must be present for each detail table unless the table supports PCT. Also, when a materialized view log is required, the ROWID column must be present in each materialized view log.
The rowids of all the detail tables must appear in the SELECT list of the materialized view query definition.
If some of these restrictions are not met, you can create the materialized view as REFRESH FORCE to take advantage of fast refresh when it is possible. If one of the tables did not meet all of the criteria, but the other tables did, the materialized view would still be fast refreshable with respect to the other tables for which all the criteria are met. -
2 same surrogate keys with different filter conditions in one report
how do we put 2 same sr keys with different filter conditions in one single report??
for example, we have to get the 'count' for tm_sr_key:
1. count(tm_sr_key) where past_due_flag = Y
2. count(tm_sr_key) where past_due_flag = Y and N
to be displayed in one single report.
it happens that both sr_keys will display the same measure (which is the 1st filter conditions)
and the filter under criteria tab in anwer will show as :
tm_sr_key where {filter condition 1}
AND
tm_sr_key where {filter condition 2}
instead of :
tm_sr_key where {filter condition 1} for 1st measure
tm_sr_key where {filter condition 2} for 2nd measure
d only option i could think right now is to duplicate the tm_sr_key data in the same table but with different name say, tm_sr_key_2..
kindly pls help.
thanxi'm sorry, not really understand.
could you pls explain a bit more about the filter column? how do we do it? coz i'm really new in this tool.
r u talking about editing the filter located under the column on the right side of the OBIEE answers?
or is it by editing the 'edit column formula' for required column; that is by replacing the 'column formula' expression with this:
FILTER(EXPS_FACT.FAC_SR_KEY USING EXPS_FACT.PAST_DUE_FLAG = 'Y') <----if it is like this, i tried it already & its giving me an error message..
thanx.
Edited by: rezza.nasha on May 28, 2009 1:26 AM -
Records from two tables in different DB's
I have two tables (in different DB's) that I need to build
results from. I want to return results from all records in table A
and when a matching record in table B is found, retrieve the value
of a sqlbit field. The catch is that there may or may not be any
records in Table B that match Table A, and there may be more than
one record in Table B, but always only one record for Table A.
Table A is [Order] (yes I know, a reserved word - not my
design) and Table B is tblOrderFollowup - here is my current SQL
statement:
****************BEGIN SQL*************************
SELECT o.StoreID AS xStore
, o.Time AS dCreated
, o.ID AS xPurchase
, c.FirstName AS sFirstName
, c.LastName AS sLastName
, c.Company AS sCompany
, c.ID AS xCustomer
, o.Type AS xType
, o.Closed AS bClosed
, o.Tax AS nTax
, fu.OrderID AS xFUOrder
, fu.bComplete AS xFUComplete
FROM [Order] o
INNER JOIN Customer c
ON o.CustomerID = c.ID
AND o.StoreID = c.StoreID
LEFT OUTER JOIN db2.dbo.tblOrderFollowup fu
ON o.ID = fu.OrderID
AND o.StoreID = fu.StoreID
WHERE o.StoreID IN ( #allowableStoreIDs# )
AND o.StoreID = <cfqueryparam cfsqltype="cf_sql_integer"
value="#FORM.StoreID#" />
AND o.Time >= <cfqueryparam
cfsqltype="cf_sql_timestamp"
value="#CreateODBCDateTime(StartOfDay(FORM.dFrom))#" />
AND o.Time <= <cfqueryparam
cfsqltype="cf_sql_timestamp"
value="#CreateODBCDateTime(EndOfDay(FORM.dTo))#" />
AND o.Closed = <cfqueryparam cfsqltype="cf_sql_bit"
value="1" />
ORDER BY o.Time DESC
***********END SQL**********************
The problem here is that when I have more than 1 record per
OrderID/StoreID pair in Table B, I get more than one result - I
only want one. I am guessing I need a sub query, but don't know how
to go about doing that at all ...You say you want only one result. Do you know which one you
want?
By the way, your query is probably not giving you the right
answer. My experience is that if you do this:
select stuff
from table1 left join table2 on something
where table2.somefield = somevalue
you get the wrong answer. What I do instead is,
select stuff
from table1 left join
(select stuff from table2
where whatever) need_an_alias on somthing
Maybe you are looking for
-
DCM command did not complete successfully (-1)
when I deploy a application in the Jdeveloper the following error occur. My server is 10g on linux. the connection test of the server is successful I cannot find a clue ** Thread[main,5,main] ** Thu Mar 23 11:02:45 CST 2006 ** ** EXCEPTION: java.net.
-
High Def Podcasts and the Classic
I recently downloaded 2 High Def Podcasts and then converted them to "iPod viewing". The last message I recieve when syncing my Classic is that it cannot moved these HD Podcasts over. Anyone else have a similar issue or know how to tell if the podcas
-
As an absolute newcomer to Lightroom 5 I have downloaded images direct from camera (IOlympus EM-1) and divided them into folders. When I go into Develop mode, some folders can be developed ok , but with images from two other folders I get the message
-
SAP SRM Issue - "Enterprise Buyer Inbox"
Dear Colleagues, We have created a buyer role with access to the function "Enterprise Buyer Inbox". Once the role is assigned to a test user, we can log in to SRM and the "Start Enterprise Buyer Inbox" shows up on the menu, and everything is ok. Howe
-
Your file could not be print due to an error on HP Deskjet PCL3 class driver on.
I purchase a new printer HP Deskjet Ink Advantage 1515, I successfully installed it but the problem while im trying to print the document is "Your file could not be print due to an error on HP DESKJET PCL3 Class driver on."