IDT 4.1 - Derived Table Question
Hello,
I working on a project and I have hit a road block, need your help...
Scenario: We have a Derived Table with multiple @prompts and I need to make this optional so that if the user does not answer any of the prompts the query should bring back results. But I tried already tried using 'optional' in the @prompt syntax like below, this makes the prompts NOT mandatory but when user does not answer these prompts we DON'T get any results...
@Prompt('Parameter Name','A',LOV,Multi,Constrained,Not_Persistent,,optional)
Any ideas and thoughts are welcome !!
Warm Regards,
Manohar Singh
This is how I I would go about debugging the issue, then.
I would temporarily pull the result of the prompt into a column of the derived table (we'll call it derived table A), and then add a dimension which displays the value of that column.
Then I would add some sort of outer join (which generates a Cartesian product perhaps -- doesn't matter for debugging, though you may want to choose a small table!) between derived table A and another table (we'll call it 'table B'). Then create another dimension on 'table B'.
Then I would run a query using the dimension from derived table A and the dimension from table B. The outer join should always give a result and allow you to see what BO is actually substituting for the empty prompt value.
If you transform the empty prompt value somehow in one of your subqueries, you could take the transformed value and turn it into another dimension on derived table A. Take it one step at a time this way and you'll eventually understand how the pieces are being put together.
Good luck!
Similar Messages
-
How do I use Derived Table to dynamically choose fact table
How do I use the Derived Table functionality to dynamically choose a fact table?
I am using BO XI R2 querying against Genesys Datamart kept in Oracle 10g. The datamart contains aggregated fact tables at different levels (no_agg, hour, day, week, etc...) I would like to build my universe so that if the end user chooses a parameter to view reports at daily granularity, then the daily fact table is used; choose hourly granularity, then hourly fact table is used, etc....
I tried using dynamic SQL in Oracle Syntax, but Business Obljects Universe didn't like that type of coding.
The tables look something like this:
O_LOB1_NO_AGG o
inner join V_LOB1_NO_AGG v on o.object_id = v.object_id
inner join T_LOB1_NO_AGG t on v.timekey = t.timekey
Likewise, in the 'hour', 'day', 'week', etc... fact tables, the Primary Key to Foreign Key names and relationships are the same. And the columns in each O_, V_, T_ fact table is the same, or very similar (just aggregated at different levels of time).
I was thinking of going a different route and using aggregate aware; but there are many Lines of Business (20+) and multiple time dimensions (7) and I believe aggregate aware would require me to place all relevant tables in the Universe as separate objects, which would create a large Universe with multiple table objects, and not be maintenance-friendly. I also was going to dynamically choose Line of Business (LOB) in the derived tables, based on the end user choosing a parameter for LOB, but that is out-of-scope for my current question. But that information sort of points you down the train of thought I am travelling. Thanks for any help you can provide!You can create a derived table containing a union like the following:
select a,b,c from DailyFacts where (@prompt('View'....) = 'Daily' and (<rest of your where conditions here if necessary>)
union
(select a,b,c from MonthlyFacts where (@prompt('View'....) = 'Monthly' and (<rest of your where conditions here if necessary>))
union
(select a,b,c from YearlyFacts where (@prompt('View'....) = 'Yearly' and (<rest of your where conditions here if necessary>))
I assume that you are familiar with the @prompt syntax
Regards,
Stratos -
Problem with WebIntelligence and Universe Designer Derived Table
Hi people, i have an issue with a report in WebIntelligence that i want to build. Here it goes:
I created a derived table that brings every material that has or not any movement. The thing is that when I build the report using other information like Material Name, for example. The report filters by the coincidence between materials in the derived table and the SAP Standard table. I tried to modify the SQL query but, Oracle does not allow it.
So here are my questions:
1)Is any way to do a Left outer join in order to have any single material and do not allow WebIntelligence to do Inline views?
2)Do i have to modify the derived table? and use the standard tables?
3)Can i work with a derived table that does not have any join with the standard tables?
Thanks in advance,
ReynaldoIf I understand you correctly, it sounds like you are getting an inner join where you want an outer join? You have several options:
1. You can do an outer join in the universe, or even embedded in your derived table (if that is what you are trying to do)
2. You can have a derived table that is not joined with any other tables in the Universe. But you will have to merge the dimensions in the Webi report, and then be sure to put the correct dimension(s) on the report in order to reflect the outer join you want.
I hope that helps. -
Hi, we are working on Business Objects Migration 6.1 to BOXIR2 project.plz any one help me Derived table creation for Free Hand SQL Reports?.How to use promt functions also.........?
Thanks for advance....
Thanks&Regards
RamuRamu,
Your question is posted in the General forum, but I think you might want to close this entry and re-post in one of the two following forums:
Web Intelligence
[SAP BusinessObjects Web Intelligence;
Universe Designer & Business Views Designer
[Semantic Layer;
Thanks,
John -
Select column in main query from sub query (derived table) -
Hi:
I have the following query - How do I select Tot_Atnd defined in the derived table
SELECT count(distinct c.prgm_id) AS "Total Completed", h.Tot_Atnd
FROM iplanrpt.vm_rpt_prgm c
INNER JOIN
*(SELECT PRGM_ID, SUM(CASE WHEN ATTENDED_IND = 'Y' THEN 1 ELSE 0 END) AS "Tot_Atnd" FROM iPlanrpt.VM_RPT_PRGM_ATND GROUP BY PRGM_ID) h*
ON c.PRGM_ID = h.PRGM_ID
ThanksHere's an example of what I think the CREATE TABLE and INSERT statements would look like for your data:
CREATE TABLE vm_rpt_prgm
( prgm_id NUMBER
INSERT INTO vm_rpt_prgm
VALUES (1);
INSERT INTO vm_rpt_prgm
VALUES (2);
INSERT INTO vm_rpt_prgm
VALUES (3);
INSERT INTO vm_rpt_prgm
VALUES (1);
INSERT INTO vm_rpt_prgm
VALUES (1);
INSERT INTO vm_rpt_prgm
VALUES (3);
CREATE TABLE vm_rpt_prgm_atnd
( prgm_id NUMBER
, attended_ind CHAR(1)
INSERT INTO vm_prt_prgm_atnd
VALUES (1, 'Y');
INSERT INTO vm_prt_prgm_atnd
VALUES (1, 'N');
INSERT INTO vm_prt_prgm_atnd
VALUES (2, 'Y');
INSERT INTO vm_prt_prgm_atnd
VALUES (2, 'Y');
INSERT INTO vm_prt_prgm_atnd
VALUES (2, 'N');
INSERT INTO vm_prt_prgm_atnd
VALUES (3, 'Y');
INSERT INTO vm_prt_prgm_atnd
VALUES (3, 'N');
INSERT INTO vm_prt_prgm_atnd
VALUES (3, 'N');But, I don't know your data. The sample data should be a simplified case of reality that represents (as best as possible) the real data set. For example, in vm_rpt_prgm, can the same prgm_id show up in multiple records? If not, the sample data I provided above is not representative of your data. Similar questions for vm_rpt_prgm_atnd: Can the same prgm_id show up in multiple records? Are the values of attended_ind 'Y' or 'N'? Can there be prgm_id's that exist in this table, but not the other? If not, again, my sample data is not representative of yours, so adjust it as needed and re-post it.
Here's some quick summary information on my sample data above:
There are 3 distinct values of prgm_id in vm_rpt_prgm.
There are 4 distinct values of prgm_id in vm_rpt_prgm_atnd.
There are 6 rows/records in vm_rpt_prgm.
There are 9 rows/records in vm_rpt_prgm_atnd.
The count of all 'Y's in vm_rpt_prgm_atnd is 5.
The count of all 'Y's in vm_rpt_prgm_atnd for only the prgm_id's in vm_rpt_prgm is 4.
So, which of these things (or other things) do you want to see in your result set?
You might say you want to see:
COUNT_OF_UNIQUE_PRGMS TOTAL_ATND_YS
3 4or...
PRGM_ID TOTAL_ATND_YS
1 1
2 2
3 1
4 1Once you clearly specify what you want, I can probably help you -
This is a question regarding best practices. The ORDM tutorial from Oracle (http://st-curriculum.oracle.com/tutorial/ORDMTutorial/player.htm) states for the ORDM Derived Layer:
"The Derived Data Model uses a low-level combination of base tables to provide information that can only be derived from base table data".
And the Oracle Documentation (http://docs.oracle.com/cd/B19306_01/bi.102/e14480/intro.htm) states: "The Derived layer stores information derived from the Base and Reference layers"
Am I right in saying that according to the layered architecture of the ORDM data model, we should populate the derived layer purely from the 3NF Base Tables, Lookups & Reference Tables?
Specifically, having a Derived Table in the Derived Layer populating another Derived Table is a violation of standards. Is this a correct assumption?
Thomas Hefter
Oracle Support Services on behalf of a customer
Edited by: user791903 on Aug 16, 2012 1:10 AMthis is correct. You could have a table or materialized view based on a derived table, but we would call that an aggregate, not derived.
-
@aggregate aware or Derived Tables ..
Hello,
the original data in my Universe has about 2 Mio. i have 2 questions ..
is there any reference values for best performance of a universe (e.g 1. Mio rows .. what ever)
how can i get best performance: @aggregate aware or with derived tables .. (other Alternatives)
Production DB: Oracle
BOXIR2 SP 4Hi,
You can get better performance with aggregate awareness, but you need the aggregate tables in the db.
As a brief overview consider a table prod_cust_order (1million rows)
Product, Customer, Order Amount
This could be aggregated to product_order Product, Order Amount (500 rows)
If the user wants to see order amount by customer then they are going to have to query the original table, but if they are interested in product only they they can go to Product_order table.
The aggegrate awareness allows you to create a measure object with both tables as the source, and will then select the approriate one when building the query based on the dimension you have selected. So if the user selects customer then it will go to the top prod_cust_order but if they don't it will source it from the much smaller Product_order table. The user does not see the change in WebI unless they look at the underlying SQL.
Derived tables are not so good for performance as the enter derived query is included in the SQL built.
Regards
Alan -
Derived tables with prompts - based universe
why can't I use derived tables with prompts - based universes on Dashboard Design 4.0? I mean I can add to Dashboard Design data coming from a universe like that but the prompts don't show in the query panel in Dashboard Design. Could it be becuase my universe was created first as an unv and then I transformed it to unx?
Good day Yuvraj,
Thank you for your response.
Basically, I have 2 classes based on physical tables:
Product (P); and
Time/Calendar (T/C).
Two classed based on derived tables:
Stock on Hand (SoH); and
Stock Movements (SM)
The derived tables SQL code selects (Quantity and Selling Price) from the SoH table and joins to the T/C table with conditions and a Where clause to restrict the data output to the last 2 months (the same applies to the SM derived table).
Example code below:
SELECT q.sm_table _no, q.tim_cal_no, q.quantity, q.selling_price
FROM tim_cal_table p,
sm_table q
WHERE q.tim_cal_no= p.tim_cal_no
AND p.day between to_char(sysdate - 60,'DD/MON/YY') and to_char(sysdate - 1,'DD/MON/YY');
Now, the SoH table and the SM table are joined (in the universe schema) to the P table and T/C table using Primary Keys (which are shared by all the tables - physical and derived i.e. foreign keys on the SoH and SM tables used in the derived tables).
Now to answer your questions:
Do you get data in case you take objects only from derived table class?NO
Does the columns used to join physical table and derived table has matching values? YES. I mean to say is the join getting satisfied? YES. Checked Universe Integrity - structure, objects, joins, conditions, loops, context and cardinalities - everything is OK.
Adding to this, is the data type same for both the columns (on which join is set) or is there any typecasting required? YES - checked the data types of the primary/foreign keys that join the tables and they all match, except for one on the SM table - the foreign key has 6 set for precision (instead of 5 as per the other columns), however the data type is Numeric so this shouldn't be an issue.
I hope this helps to clarify the nature of the problem.
Thank you.
Regards,
B -
How to process each records in the derived table which i created using cte table using sql server
I want to process each row from the CTE table I created, how can I traverse from first row to second row and so on....
how to process each records in the derived table which i created using cte table using sql serverIdeally you would be doing a set based processing rather than traversing row by row as thats more efficient. To answer it specific to your scenario we may need more info. Can you explain with some sample data your exact requirement?
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Dear Experts,
Can anyone tell me in which scenario we will go for derived table? We are creating a report on top of a Cube,
Thanks,
Kind Regards,
Sathish Kumar.NHi Sathish,
Hope this helps:
http://scn.sap.com/thread/2019524
http://www.forumtopics.com/busobj/viewtopic.php?p=684054&sid=13e89b7f7b9e97d6921e9899023e3929
http://www.forumtopics.com/busobj/viewtopic.php?p=770433&sid=1f947ce435f0c0b96ebed248a1c908a0
regards,
M -
CASE Statement is not working Derived table
Hi All,
in the bello SQL Statement case statement is not working in derived table. I am new to creation of derived table if any body knows plz kinldy help me out on this.
SELECT x.market, x.droprate as med1
FROM
(select upper(market_name) as market, fulldate as date_value,
(sum([Dy_LOT_DROPS_N][Dy_OB_HO_DROPS][Dy_NonRF_Drop]))/
nullif(sum(CASE WHEN (month(BBHDLY.FullDate)}>= 6 and { year(BBHDLY.FullDate)} = 2011) or {fn year(IDENSLABBHDLY.FullDate)} > 2011
THEN BBHDLY.Dy_Calls - BBHDLY.Dy_HO_CHAN_ALLOC ELSE BBHDLY.Dy_Calls END),0)*100 as droprate
from BBHDLY sla
inner join Dim mkt
on sla.bts_name = mkt.bts_name and sla.SectorID = mkt.Sector_Id
where fulldate >= GETDATE()-46
group by market_name, fulldate) x,
(select market_name as market, fulldate as date_value,
(sum([Dy_LOT_DROPS_N][Dy_OB_HO_DROPS][Dy_NonRF_Drop]))/
nullif(sum(CASE WHEN ({fn month(BBHDLY.FullDate)}>= 6 and {fn year(BBHDLY.FullDate)} = 2011) or {fn year(BBHDLY.FullDate)} >
2011 THEN BBHDLY.Dy_Calls - BBHDLY.Dy_HO_CHAN_ALLOC ELSE BBHDLY.Dy_Calls END),0)*100 as droprate
from BBHDLY sla
inner join Dim mkt
on sla.bts_name = mkt.bts_name and sla.SectorID = mkt.Sector_Id
where fulldate >=GETDATE()-46
group by market_name, fulldate) y
where x.market = y.market
GROUP BY x.droprate, x.market
HAVING
SUM(CASE WHEN y.droprate <= x.droprate
THEN 1 ELSE 0 END)>=(COUNT(*)+1)/2 AND
SUM(CASE WHEN y.droprate >= x.droprate
THEN 1 ELSE 0 END)>=(COUNT(*)/2)+1
ThanksIt looks like SQL Server or Sybase given that you're using getdate().
As such, Vinesh's comment to use decode is wrong - decode is Oracle syntax.
Looking at your statement again, I've noticed the following:
you have no { to match the first } - not sure why you're using them anyway.
you haven't given x.market a name - use x.market as market instead
use coalesce instead of nullif if you're on SQL Server. -
Can we create prompts in Derived Table sql query
Hi,
I am trying to define derived table sql query as below. Though the syntax parsing is going through but when I am generating the report it is throwing and invalid prompt definition error.
" select * from table_a where call_direction = @Prompt('Enter Call Direction','A','"derivedtable_a".SHORT_STRING',mono,free,not_persistent,) and
where call_type = @Prompt('Enter Call Direction','A','"derivedtable_b".SHORT_STRING',mono,free,not_persistent,) "
Can somebody please share your thoughts if this can be achieved in universe or not ?
Appreciate immediate responses as it is a show stopper for my deliverable.
Thanks in advance.
Thanks and Regards,
Shireen.Hi Shireen
We can use prompt in the derived table. There is issue with the SQL that you have used while creating the Derived Table.
Instead of using the "derivedtable_a".SHORT_STRING' field use the object from the class on which you are creating the derived table.
For example: If you are creating a derived table in the sample universe efashion on Agg_yr_qt_rn_st_ln_ca_sr table then use the following query:
SELECT *
FROM Agg_yr_qt_rn_st_ln_ca_sr
WHERE Agg_yr_qt_rn_st_ln_ca_sr.Yr = @Prompt ('Enter Value','C','Time Period\Year',mono,constrained)
Hope this helps!
Thanks -
This is an html table question, but since I am working with
CF on this, I thought I would post here for help.
I query and cfoutput the data in a table. The table has ten
columns. The first five are alpha numeric and the last five are
numeric. The output displays fine.
What the want to do now is to put a black border around the
number columns, the last five.
I tried to make each column its own table, but that just puts
a box around each value, the columns are not connected.
How can I do this ?
Thanks for helping.Put a thin black left border in the sixth column and a
similar right border in the tenth (last) column.
It is neater and advisable to use CSS.
<style type="text/css">
<!--
.bdrLft {
border-left-color:#000000;
border-left-width:thin;
-->
</style>
<td class="bdrLft">
The inline formatting will look like:
<td style="border-left-color:##000000;
border-left-width:thin;">
Do the same for the top border (last 5 column headers). The
bottom border may be trickier. The idea is to apply bottom border
at the last query count. One can do without the top and bottom
borders, however. -
Adding derived table to-Universe issue!
Hi,
I am trying to add a derived table to my Universe by writing a SQL query, after some length of the query its not enabling me to write more.Could soemebody suggest is there any limit I can write upto or is there anyway I can increase the capacity of the length of the query.Thanks in Advance.How big is your query. I think there is a limit based on the edit box of about 32k but that is all
It is possible to create derived tables based on other derived table using the @DerivedTable function. You might be able to break your query into smaller parts and build it that way
Regards
Alan -
Reference a Derived table in another Derived Table
Is it possible to reference a derived table from another derived table? I am using Business Object XI 3.0.
This is not possible as the Designer wants physical tables...
What you could do is create the second derived table as follows:
SELECT table1.col1,
table1.col2,
table2.col1,
table2.col2
FROM table1,
(SELECT col1,
col2
FROM atable) table2
Regards
Jacques
Maybe you are looking for
-
Have photoshop cs6 for windows and am now migrating to a mac with Yosemite installed. Where can I download the cs6 for mac? And can I use the same serial no that I received for windows.
-
I changed my visited link colors to red-visited,green-not visited.but now have lost the search button in Amazon.The button is not showing up,But does work if I click on the area where it used to be.
-
How can I randomize themes in EP6 SP2? I'd created 5 different themes and I would like to show a random theme every time a new user logon. Any idea? tks, Marcelo
-
HOW TO ADD GROUP BY CLAUSE WHEN USING Jbo:Datatable
Would like to know if there are any provisions for adding a Group by clause so the data shown using DataTable Component cn be grouped. eg: Currently using DataTable component shows data as shown below. Dept Name 10 ABC 10 DEF 10 PQR 20 XYZ 20 QQQ Can
-
I get a black screen with the message: UniNEnet: Ethernet address 00:30:65:6d:fd:90 Localhost:/root# iMac Snow Mfg: 2000, 500 MHz, 256 MB Memory OS 10.3.5 Combined Update This happens at Startup I tried to use Disk Utility but it shows a problem; got