Options Complex Aggregate in ODI interface
I have one source and i need a one target aggregate table.
I have implemented the next sample query:
SELECT
ATRIBUTE1,
ATRIBUTE2,
ATRIBUTE3,
SUM(ATRIBUTE4),
SUM(ATRIBUTE5),
AVG(SUM(ATRIBUTE4+ATRIBUTE5)/ATRIBUTE6),
FROM TABLE_AGG
GROUP BY SUBSTR(ATRIBUTE1,0,6),ATRIBUTE2,ATRIBUTE3
¿Options to implement this query or similar please?
Thanks
Have you looked at this thread?
how to use GROUP BY in ODI
Just add the SUM operator to the required target fields in your ODI interface and the GROUP BY clause will be added automatically by ODI. I note that you have a group by field that doesn't exist in your select list - was this deliberate?
Similar Messages
-
How to set a group by clause in ODI interface?
How to set a group by clause in ODI interface?
In ODI, group by method will be triggered automatically when any one of your mapping contains aggregate functions.
Thanks,
Saravanan Rajavel -
Synchronize RDBMS source view with ODI Interface
Hello ODI expert(s),
I'm new to ODI & hence experimenting.
I'm trying to load metadata from a SQL Server view to Oracle's Hyperion Planning.
My question is w.r.t source.
I've 6 columns in my source view. All 6 were mapped to the appropriate target fields. Suppose a column is removed from Source view. Is there any option in ODI to synchronize i.e. exclude the (now)unwanted column(& hence mapping) from the ODI Interface, I initially created?
Awaiting one of your responses.
- NateshI can relate to your issue.
ODI does this to me all the time.
The Operator logs show all greens and show no error, but no data makes its way to the Target.
I usually remove one mapping at a time and re-run the Interface. That helps me pin-point what might be the issue. Very frustrating. -
Running ODI Interface from BPEL WEB SERVICE
Guys,
How to invoke ODI Interface from BPEL Web service?
i.e can we use odistartscenerio?if we can then how to pass conext/agent as parameters?
CheersYou need JavaEE agent and configure odi run time service. BPEL can then call this service to start an odi scenario.
For details refer to http://docs.oracle.com/cd/E15586_01/integrate.1111/e12643/running_executions.htm#BABDHJJF
and for installation of JavaEE agent http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/setup_jee_agent/setup_jee_agent.htm (as part of extending the domain you get the option to deploy this service)
Regards,
Harris -
Error when trying to execute ODI Interface
Hello,
I receive the following error when I try to execute an ODI interface. The interface contains two models trying to load a .csv file into an Oracle table. The models seem to be working and I can right click on the source file and "View Data". I have specifed LKM File To Oracle (SQLLDR), IKM Oracle Incremental Update, and CKM Oracle. But still receive this error on the fourth step of the execution "Loading - SS_0 - call sqlldr via Jython"
org.apache.bsf.BSFException: exception from Jython: Traceback (innermost last):
File "<string>", line 3, in ?
OS command has signalled errors
at org.apache.bsf.engines.jython.JythonEngine.exec(Unknown Source)
at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i(e.java)
at com.sunopsis.dwg.cmd.g.y(g.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source)
Thank you for your helpAlmost...
You need the sql loader where the "OS command" will execute it means where the agent is installed (once you will execute it from an agent when at production).
AND that machine where the agent is, need to "see" the target database through the Oracle Listener (tnsnames)....
Is just like to execute a Sql Loader from you own machine, but who write the command will be ODI.
Does it make any sense to you?
Message was edited by:
Cezar Santos -
What is use of Active mapping in ODi interfaces?
hi,
What is use of active mapping in ODI interfaces ?
What are the advantages of using active mapping?
If active mapping is not used in ODI ,would it affect ODI code in some sense?
Thanks,
MaheshMaheshGx wrote:
hi,
What is use of active mapping in ODI interfaces ?This ask ODI to generate for for the mapped column . Other wise no code will be generated .
What are the advantages of using active mapping?If you want to generate code use active mapping .
If active mapping is not used in ODI ,would it affect ODI code in some sense?
It will not generate the code
Thanks,
Mahesh -
Can we set the Option "Show add-in user interface errors" with VBA?
Does anyone know if the advanced Option "Show add-in user interface errors" can be set with VBA in Project Pro 2013?
\Spiro Theopoulos, Montreal, QC (Canada)Spiro,
Sorry but as far as I know that option is not available through VBA.
John -
How to Comapare Row by Row in ODI Interface
Hi all
i want to Compare Record by Record from my Source Table.
Can any one Explain Logic How can i do through ODI Interface?If you want row by row processing (rather than set based) then look at using Knowledge Modules that implicitly use a cursor via the agent to load the staging table (e.g LKM SQL to SQL) or a KM that explicitly uses a cursor to load the target table (e.g IKM Incremental updata row by row).
It wont be as fast as set based though!
What do you want to do with each row? Can you load them all into the staging area and then process row by row? -
Dynamic Column Name in ODI Interface
Hi Everyone
I have a requirement to read a set of columns from source table and move the data to target table. Set of columns are decided dynamically based on parameter say PVV_PREFIX.
For example, assume the following tables
Source: Employee (OFFICE_ADDRESS1, OFFICE_ADDRESS2, OFFICE_CITY, HOME_ADDRESS1, HOME_ADDRESS2, HOME_CITY)
Target: Address(TYPE, ADDRESS1, ADDRESS2, CITY)
Now, if scenario is called PVV_PREFIX=OFFICE, then OFFICE_* columns should be mapped to target table
if scenario is called PVV_PREFIX=HOME, then HOME_* columns should be mapped to target table
In actual requirement there are more than 30 such columns. Declaring those many variables is really not practical, rather we prefer to #PVV_PREFIX + '_ADDRESS1' kind of approach. But not getting supported in ODI Interface.
Please let me know if this requirement is feasible via ODI Interface or we need to do only using ODI procedure. Thank you
Regards
PrasadPrasad,
You can do it using single interface itself but you will need to customize the KM .
Step 1. Create Interface mapping with appropriate Source to Target Mapping.
Step2. Customize KM in such a way that you add prefix PVV_PREFIX. This can done using ODI Variable or Java
Step 3. Execute and test you interface
Please let me know if you have any question in above approach . -
Hi all,
Someone please enlighten me on the use of options in aggregates:-
1) "propose query defination"
2 )" propose from bw statistics"
3) "propose from bw statistics (tables")
4) "propose from last navigation"
5) "propose from statistics usually query
Are these options used to know the aggregate functionality at the beckground.... Someone please give their invaluable thoughts on this..
thanks and regards,
shalini.
Message was edited by: shalini guptaShalini,
Check this..
http://help.sap.com/saphelp_sem40bw/helpdata/EN/80/1a67abe07211d2acb80000e829fbfe/content.htm
Regards,
Marc. -
Basic Issue with ODI interface
Hi All,
I have a very strange problem.
I am coding my second interface in ODI.
Its very simple
Joining 4 tables ,with one filter and connect it with the target table.
The interface when executed runs fine,without any error.
But the target table doesn't get populated.
So when i check the ODI interface at every step via the Operator navigator,I get no error at any step.
step1) drop a table (this comes as a warning as no table exists)
step2) create a view(this step suceeds ,but when i check the database the view is not created)
STEP 2 is a real issue and I can't understand as to why this view is not
getting created in database,when the step completes successfully
Pls can someone suggest where should i look for ?
rgds
sI can relate to your issue.
ODI does this to me all the time.
The Operator logs show all greens and show no error, but no data makes its way to the Target.
I usually remove one mapping at a time and re-run the Interface. That helps me pin-point what might be the issue. Very frustrating. -
Not sure why I am not getting how to aggregate in ODI! I have been trying to come up with a way to produce these results in ODI for 2 weeks now, and I am missing something. I don't believe this should be that difficult. This is the sql code I am using in sqlplus to yield test results and here is my scenerio:
sql:
select project_code
from
(select project_code, floor(sum(unit_price*quantity)) as total
from table1
where order_base_number=8004
group by project_code)
where total =
(select max(floor(sum(unit_price*quantity)))
from table1
where po_header_id = 8004
group by project_code)
and rownum = 1;
Source: Table1 contain fields:
order_base_number
order_mod_number
line_item
quantity
unit_price
project_code
Target: Aggregate_Table_1 contains
order_base_number
order_mod_number
aggregate_project_code = the project_code should be the project code with the highest total_cost grouped by order_base_number,order_mod_number (if the result returns = value then return 1st occurence rn=1)
for example,
order - 1001
mod_number - 200
line_item - 1
quantity - 100
unit_price - 100
project_code - 55001
order - 1001
mod_number - 200
line_item - 2
quantity - 100
unit_price - 10
project_code - 55002
order - 1001
mod_number - 200
line_item - 3
quantity - 100
unit_price - 5
project_code - 55001
Results
order_base_number - 1001
order_mod_number - 200
aggregate_project_code - 55001Sorry for the late reply .
Here are the two solutions i can think of
SOLUTION 1
Here replace the above case statement with below modified query . Please provide the table name with schema.table_name format and also change the column names accordingly.
SELECT DISTINCT
ORDERS,
MOD_NUMBER,
CASE WHEN RANK () OVER (PARTITION BY ORDERS,MOD_NUMBER ORDER BY (UNIT_PRICE*QUANTITY) DESC )=1
THEN PROJECT_CODE
ELSE
( SELECT * FROM
SELECT DISTINCT CASE WHEN MAX(UNIT_PRICE*QUANTITY) OVER (PARTITION BY ORDERS,MOD_NUMBER) = UNIT_PRICE*QUANTITY
THEN PROJECT_CODE END "PROJ_CODE"
FROM ORD )
WHERE PROJ_CODE IS NOT NULL )
END
FROM ORD;In the above code what i am actually doing is bring the same max project code even in else condition , so instead of project code and null there will be only single distinct project_code and should give you the results you are looking for .I have tried with the data you have provided.
Solution 2- Using Temporary Table.
CASE WHEN RANK () OVER (PARTITION BY ORDERS,MOD_NUMBER ORDER BY (UNIT_PRICE*QUANTITY) DESC )=1
THEN NVL(PROJECT_CODE,'NA')
END Modify the case statement this way so that your results will be some thing like this
6007 6002 111110
6007 6005 NA
6007 6006 111130
6007 6006 null
Now before loading into target table add a filter for nulls so that you load all nulls and for records with na
use replace to change NA to nulls
REPLACE( <COLUMN_NAME>,'NA',NULL) hope this solves your requirement. -
Regarding logical joining of two table by using ODI interface
I have a two table in database.i have to logically add them, with the help of ODI interface.which should reflect in target.
there is a smple cinario regarding ,convertion of relational table to flat file.
but how to reflect mutiple table through joining in target from source.Hi
Please correct my understan on your query
You want to say that, you have two tables at source side and want to store data to target table, later from target to flat file
or
You have two target table want to store data into flat file
Thanks
Phani -
Error when adding multiple source data stores in ODI Interface
I am trying to create an ODI Interface with couple of source tables and one target table. Say for example I am using the following data structure in my target table.
Order (Target Table)
order id
product id
customer id
address id
warehouse id
shipment id
for the above target table i need to extract data from each of the following source tables.
orderitem
product
customer
address
warehouse
shipment
Total 6 source tables i need to join however and load data for target table.
When I drag source data stores in to ODI interface mapping tab It throws the following Null Pointer Error. Due to this error I am not able to map target table with all the source tables.
Please suggest me what could be the reason for the error.
Error:
java.lang.NullPointerException
at oracle.odi.interfaces.interactive.support.clauseimporters.ClauseImporterDefault.importClauses(ClauseImporterDefault.java:81)
at oracle.odi.interfaces.interactive.support.actions.InterfaceActionAddSourceDataStore.performAction(InterfaceActionAddSourceDataStore.java:124)
at oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions.performAction(InteractiveInterfaceHelperWithActions.java:845)
at oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions.performAction(InteractiveInterfaceHelperWithActions.java:821)
at oracle.odi.ui.OdiSdkEntityFactory.dropSourceDataStore(OdiSdkEntityFactory.java:523)
at oracle.odi.ui.etlmodeler.diag.dragdrop.DiagramNodeDropHandler.dropObjects(DiagramNodeDropHandler.java:150)
at oracle.diagram.framework.dragdrop.handler.DelegateChooserDropHandler.dropSelected(DelegateChooserDropHandler.java:386)
at oracle.modeler.dnd.ModelerTCDropHandler.access$001(ModelerTCDropHandler.java:69)
at oracle.modeler.dnd.ModelerTCDropHandler$3.run(ModelerTCDropHandler.java:288)
at oracle.modeler.dif.GraphicAdder.addImpl(GraphicAdder.java:387)
at oracle.modeler.dif.GraphicAdder.addAndLayoutImpl(GraphicAdder.java:372)
at oracle.modeler.dif.GraphicAdder.addSelectAndLayout(GraphicAdder.java:348)
at oracle.modeler.dnd.ModelerTCDropHandler.dropSelected(ModelerTCDropHandler.java:284)
at oracle.diagram.framework.dragdrop.handler.DelegateChooserDropHandler.drop(DelegateChooserDropHandler.java:150)
at oracle.diagram.framework.dragdrop.DefaultDropPlugin.drop(DefaultDropPlugin.java:115)
at oracle.modeler.dnd.ModelerDropPlugin.drop(ModelerDropPlugin.java:100)
at oracle.diagram.framework.dragdrop.DropTargetHelper.drop(DropTargetHelper.java:188)
at oracle.diagram.framework.dragdrop.ManagerViewDragAndDropController$MyDropTargetListener.drop(ManagerViewDragAndDropController.java:802)
at java.awt.dnd.DropTarget.drop(DropTarget.java:434)
at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:519)
at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:832)
at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:756)
at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:30)
at java.awt.Component.dispatchEventImpl(Component.java:4487)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4312)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4163)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)Hello,
does somebody have a solution for this issue?
I am new to ODI and have the same problem. I am using ODI Designer Standalone Edition Version 11.1.1.
Maybe there is something wrong with my configuration, maybe I am doing something wrong while creating the mapping graphically. It does not help to save and re-open the mapping. Also it does not help to re-reverse engineer the objects. Also it does not seem to have something to do with the number of objects joined (some objects seem to always cause this error, with some the error starts when there are 10 or more objects on the map before they are added).
One possible workaround i have found is to do it all on the quick-edit tab by one by one creating the joins and mappings (+source or lookup joins and filter mapping). It seems to work with my configuration, but drag&drop functionality on the mapping tab would sometimes be faster, more convenient and just more human like.
Br,
Jaanus -
Complex aggregates through answers
I have a sales table formatted like
country_id,product_id,date
(int,int,date)
or say, region, district, month in the paint demo
and I'd like to produce a single variance metric for each country_id/product_id pair based on the user's input of interval. Essentially, I want to group the number of orders by an interval (say, 20 seconds or whatever the user enters) and then do some sort of time series analysis on them (for example take the variance of that grouping)
If I were doing this in raw SQL I would create a nested query that built up the count of country_id/product_id/( count by date/20 ) and then worked over those values, but I was hoping OBIEE had some mechanism to work over such queries in a more intuitive manner. I can do this in Answers by creating hideously complex aggregates in the column formulas - is there a better way? This seems like a pretty common use case
thanksCould you include a little worked example so its easier to visualise your requirement?
Maybe you are looking for
-
New to this game! Basic questions I suppose ! !
Hi everybody! I just attended an Oracle presentation of Ifs. The product seems very interesting. I would need some information in order to evaluate Ifs versus our company needs. Thanks for answering!! 1. I know thatwe can add custom properties to fol
-
Screen resolution preferences does not work for me...
I have a 1920x1080, 17.4 laptop. That is approx 126.6 ppi screen resolution if my calculkations are correct... So in order to set PS to display real size of the images according to the zoom, I go to edit / preferences / units & rulers and set the scr
-
Best companion monitor to 27" imac (not expensive)
Hello, I was wondering if anyone had any good suggestions for a good monitor that could be used with my 27" iMac. I am not looking to spend $999 on a Cinema display or even half that. I was thinking of getting a 21"-24" and was hoping for it to have
-
All representatives are actively assisting other customers. There are 3 customer(s) in line ahead of you. Thank you for your patience. You are now chatting with Suresh. Suresh: Hello! Welcome to Adobe Customer Service. Hugues: Hello Suresh: Please al
-
I recently got my iPhone 5c stolen. How can I track it?
I recently got my iPhone 5c stolen. How can I track it?