"If" Condition in ODI

Hi,
I'm new to ODI. I want to implement the "if" condition in ODI. Can we do it using variables? If yes, how can we implement it?
Variable 1 = my condition is "if source_column1 > 0 Then 1 Else 0"...
Variable 2 = If variable1=0 then <action1> else <action-2>
After calculation, I need to assign these variables to the target column.
Please help.Thanks.

Thanks a lot SH and Yellanki.
But I need to apply 4 business rules in the single column. For example, let the source column "src_column_q1". Each step got its own arithmetic operations and it's given as <temp_value>.
ie, Check src_column_q1 > 0 then 1 else 99
If <step1>=99 then <temp_value2.1> else <temp_value2.2>
If <step3>=<temp_value2.1> then <temp_value3.1> else <temp_value3.2>
If <step4>=<temp_value3.1> then <temp_value4.1> else <temp_value4.2>
In the target column (trgt_column_q1), we need to give temp_value 4.1.
Appreciate your help.

Similar Messages

  • Case when condition in ODI Load Plan

    Hi All,
    Created a project variable(VAR_X) which is a text type and it can be refreshed by querying in some database.
    Created a Load Plan and added a Case step by using VAR_X
    with following logic
    Case VAR_X
    when value ='X'
         run_x_scenario.
    when value='Y'
         run_y_scenario.
    else
    but whenever I give start up value X or Y ,variable unable to evaluate the when condition provided in the load plan.
    always its taking else step
    Case VAR_X
    else
    but its working when I evaluate with numeric number like when value =1 etc (here I changed variable datatype to numeric)
    Any pointers will be appreciated.
    Thanks,
    Aravind

    It may be due to the quotes you have added in your when clause. Can you try it without quotes.

  • Using records that satisfy and do not satisfy join condition

    Hi,
    My requirement is to use the records which satisfy and do not satisfy the join conditions in ODI.
    Can any one explain how to achieve this?
    Thanks in advance.
    Regards,
    SRK

    Hi Katukota,
    Thanks for the suggestion. When i tried to implement the same with an OUTER JOIN to capture the records that satisfied and not satisfied the join condition, the SQL statement is not getting created properly and as given below
    "from DEPT [empty] EMP where     (1=1) And (DEPT.DEPTNO=EMP.DEPT(+))"
    THere is no ',' operator between the two tables in the FROM Clause. When it is corrected in the ODI operator, the task is executed successfully.
    Can you please suggest the way forward to avoid this error?
    Thanks in advance.
    Regards,
    SRK
    Edited by: user6416145 on 04-May-2009 14:13

  • Using Variables

    I have a query regarding variable usage in filter condition using ODI tool.
    For e.g. File name column of table should be equal to variable value and the syntax used is :
    AL_SUP_LEV_0_TBL.FILE_NAME='#XXCNV_SUPPLIER_CONV.G_CHR_FILE_NAME'
    I have tried using filter both on Source and staging area using above syntax.
    But when I execute the interface it’s not inserting any record though its showing the filtered data when I put filter on source.
    Please help me regarding same.
    Regards,
    Vineet

    Hi,
    Do you still need help on this?
    If yes, what kind of variable is it) (last value, not persistent...)

  • Odi_condition in mapping gives error

    My source and target columns are in different schemas.
    Source table:
    column1| column2
    sc1 | app1
    sc2 | app2
    Target Table:
    T_column1|T_column2
    T_column1=select column2 from source table where column1=sc1
    T_column1=select column2 from source table where column1=sc2
    when i put this condition for the target column in the property inspector of the target datastore filed.I get this error '"FROM clause not properly mentioned'".
    Where do i put this condition in odi ??
    Edited by: 851305 on Oct 13, 2011 6:17 AM

    Hi
    try below one
    take two project variables and add both select queries in varaibels like below
    Varaible details:
    Name : Var1
    Datatype : Alphanumeric
    schema : source database logical schema
    Description : select column2 from source table where column1=sc1
    Name : Var2
    Datatype : Alphanumeric
    schema : source database logical schema
    Descrition: select column2 from source table where column1=sc2
    add both variables in package and target end
    Target Table:
    T_column1|T_column2
    T_column1=#projectcode.Var1
    T_column1=#projectcode.Var2
    Hope this may resolve your issue
    Note: Make sure that two variables and interface are link with * ok> * eg: Var1--ok-->Var2--ok-->interface
    Thanks,
    Phani

  • ODI constraints/condition

    Hi,
    I am doing my first interface/mapping in ODI.
    After creation of the datastore (via standard reverse engg) ,I have added a condition/constraint of not null to a column.
    When i right click the data store control > check
    I get error " CKM not selected ".
    Is anyting to do with Agent selection/setting ?
    Thanks
    S

    It's nothing to do with agent. The constarint checking functionality is performed via a Check Knowledge Module i.e. CKM. You will have to aselct a CKM relevant to the technology of your Data Store e.g. Oracle SQL Server etc. You will probably not have the CKM imported into your project so your first step will be to go to Knowledge modules in your Project and import the appropriate CKM. It will then be available in the Knowledge Module dropdown selection on the Check Tab.

  • Conditional Flow using ODI Procedures

    Hello Experts,
    I want to implement if else conditional flow in my ODI procedure. Is it possible to implement this?
    Please help. Thanks in Advance
    -- Harshad

    HI,
    In the ODI page there is a pdf called: oracledi_km_development.pdf
    This manual can tell you a lot about those commands.
    Please, remember to check any questio that was helpful or correct in the post, and to close the post when you think your problem is solved. That will help other users with the same problem.
    Cezar Santos
    [www.odiexperts.com]

  • ODI Packages execution based on condition

    Hi,
    We have clear the data using calc scripts and then load data into Hyperion using ODI packages. Currently i have one Package (Package1) to be executed on WD2 & WD3.
    I have created an interface which will execute the script.
    Here calc scripts are different which are to be executed on WD2 & WD3. I want to have all the steps in single package using any conditions.
    Example:
    Step1 - to check whether it is WD2,
    If yes go to step2 and so on till step6.
    If no, then go to step7.
    Can any one help me on this
    Thanks
    Damo

    Hi,
    ODI variables could be useful for you. Use refresh variable step with appropriate query, then evaluate variable step and organize your logical branching. You could learn about variables fron Developer's guide http://docs.oracle.com/cd/E14571_01/integrate.1111/e12643/procedures.htm#CHDIFIGB (for ODI 11g).

  • Can column be repeated in ODI based on conditions

    hi,
    I have two queries :
    1-can a field be repeated depending on some validation/ business condition while transforming data from a table or file??
    2-can we execute any ODI scenario from command prompt also???
    thanks in advance .......

    ritika ,
    you want to create column at the run time but what if half of the record are less than 18 and few more 18 then what will you do , sorry if i have misunderstood your question .
    I would jsut keep the column created during creating table.
    Next put a case condition
    CASE WHEN  <SOURCE_TABLE.COLUMN_NAME> < 18 THEN 'MINOR'
    ELSE NULL
    END Hope that helps.

  • ODI Conditions

    Hi ,
    i am moving data from FLAT FILE----> stage table------> target table.
    interface1 ----> flat file to stage table(oracle) ----> no transformations just simple load of evrything from file to table
    interface2 ----> load data from stage table to target (oracle)
    I have included this ODI Condition (constraint) on stage table.
    REGEXP_LIKE(BILL_TO_PHONE,
    '^[0-9]{3}-[0-9]{3}-[0-9]{4}$')
    Please let mw know where i have check this constraint (in 1st or 2nd interface)....
    as of now i am checking this contraint in interface1 because this contarint is not showing up in interface2.
    Thanks

    1.) If the purpose of the stage table is only to perform validations on the data, then you dont need a stage table.
    You can put the constraint on the target table and set the FLOW_CONTROL to Yes in the Interface.
    2.) ODI doesnt provide any out of the box functionality for correcting E$ tables.
    I can think of approaches to do these corrections but this will require some design and coding effort both in terms of database tables and KMs. These tables will provide metadata information on correction rules which can be accessed by KMs to perform corrections. And then you can use RECYCLE_ERRORS = Yes to process the records into the target table.
    However, ODI has a supporting module known as Data Quality + Data Profiling. This comes in the same install as that of ODI. This supposedly can do corrections on your data based on some business rules. Data Profiling is an easy to use tool but I donot know much about Data Quality. Also, I could not figure out how to integrate Data Profiling and Data Quality in ODI interfaces and packages.

  • ODI 10g delete conditional row Using KM

    Hi I will add new step to ODI 10g IKM control append
    I want to delete from target some columns where is being on source.I will capture updating or new rows then I will delete this rows from target according to UK of Target end of this I will insert.I wrote new step like this:I selected UK rows on target
    delete from <%=odiRef.getTable("L","TARG_NAME","A")%> T WHERE (<%=odiRef.getTargetColList("", "[COL_NAME]", ", ", "\n", "UK")%> )
    IN
    SELECT ---Which method can ı use here?
    FROM <%=odiRef.getFrom()%>
    WHERE (1=1) AND
    <%=snpRef.getJoin()%>
    <%=snpRef.getFilter()%>
    <%=snpRef.getJrnFilter()%>
    <%=snpRef.getGrpBy()%>
    <%=snpRef.getHaving()%>
    /*commit*/
    I have two source S1 and S2
    For example my target table is like this:
    Target
    Asset_id(UK)---it comes from source table. S1.ROW_ID--->T.ASSET_ID
    root_asset_id(UK)it comes from source table of S2.PROD_ID-->T.ROOt_ASSET_ID
    cre_dt(NOT UK)
    etc
    Now I want to compare like this :
    Delete from target T where (T.ASSET_ID,T.ROOT_ASSET _ID) IN
    (SELECT S1.ROW_ID,S2.PROD_ID
    FROM SOURCE S1 SOURCE S2)
    How can I modify ?
    Could anyone help me?
    Best Regards,
    Thanks

    Tell me if I'm wrong : you want to delete in Target the data that are in source.
    And insert only source records that were not in your target.
    And keep in target data that are not in source.
    If so, you can do it like this :
    1) Use a copy of "IKM incremental update".
    Edit the step "flag row for update"
    Rename it to "flag row for delete"
    update     <%=snpRef.getTable("L", "INT_NAME", "W")%>
    set     IND_UPDATE = 'D'
    where     (<%=snpRef.getColList("","[COL_NAME]", ", ", "", "(UK)")%>)
         in (
         select     <%=snpRef.getColList("","[COL_NAME]", ", ", "", "(UK)")%>
         from     <%=snpRef.getTable("L", "TARG_NAME", "A")%>
    ==> each row of your I$ table that ARE in your target table are now flagged as "D" for "deleted".
    it means that each row of your target table that are in source will be flagged as D in your I$ table.
    2) Then create a new step "delete row in target" like this :
    delete from <%=snpRef.getTable("L","TARG_NAME","A")%> T
    where (<%=snpRef.getColList("", "\tT.[COL_NAME]", ",", "", "UK")%>) IN      
    (     select <%=snpRef.getColList("", "\t\tS.[COL_NAME]", ",\n", "", "UK")%>
         from <%=snpRef.getTable("L", "INT_NAME", "W")%> S
         where IND_UPDATE = 'D'
    ==> each row flagged as D will be deleted in the target table

  • If condition in a Package

    Hi all,
    I am new to ODI. I have got the following requirement.
    I have got two interfaces. 1. Daily Sales 2. Monthly Sales.
    My requirement is to execute the Daily Sales interface every day except the First Day of the Month. On the First Day of the month, Monthly Sales interface should be executed. And I have got two Global variables. 1. Present Day 2. First Day of the Month.
    I am planning to create a Package and my idea is if variable1 = variable2 then execute the Monthly Sales interface if not execute the Daily Sales interface...but I don't know how to do this using ODI.
    Can someone please help to me to achieve this? Thanks in advance.

    Yes we needs to call the same Variable twice in Refresh and Evaluate Mode. The refresh will always refresh and pick the latest value and Evaluate check the condition . If we don't do refresh then evaluate will pick the last stored value and give us wrong results.
    Now in order to handle the Yearly Sales , the method is similar to what i have suggested earlier.
    Step 1. Create a Variable ( GET_YR_FRST_DY) and paste the following code
    SELECT TO_CHAR(SYSDATE,'DDMM') FROM DUAL Step 2. Drag and Drop the Variable ( GET_YR_FRST_DY) in Refresh
    Step 3 . Drag and Drop the Variable ( GET_YR_FRST_DY) in Evaluate
    Operator = 0101
    Step 4 . If true (OK) then Yearly Sales
    Step 5. join Daily Sales and Monthly sales both to Step 2 (i.e GET_YR_FRST_DY) Refresh . This way you can handle all of them in one single package.
    Please let me know if you have any question.

  • ODI behavior is not consistent in case of LKM loading.

    Hi All,
    I am facing a strange problem in ODI version 11.1.1
    Actually, we have couple of interfaces and one master package. We are generating scenario for master package. We are exporting that scenario and keep it at specific location so that our application can pick it up and can execute it.
    So the problem is something like this: If I execute scenario from ODI then it is working fine(irrespective of source and target [that may on same db (but diff schema)or different db]). But if I test this same scenario through application then it fails. So I come back to ODI and open interface, save it once again and regenerate scenario, deploy it on application. It will start working. And it may fail for other interface. I have to do same thing (opening the interface and close it after saving)once again.
    Now let me come to technical point as well as my observation.
    Actually, Loading knowledge module should get execute first. It will take data from source and load it in work tables(C$ tables). And then from work table to integration table(I$ table). But this is not happening in case of failed interface. Directly it is trying to fetch data from source and load it in I$ table. While doing this way, it was not able to access source table from target schema. So we were getting 'table or view does not exist' error.(All these, we are trying on same db but different schema). I am surprised because in this way it should get fail from first interface itself. Sometimes I also noticed that, for successfully executed interface, Load Knowledge module was loaded. Only in case of failed interface, Load knowledge module was not getting loaded. After re-saving of interface if we execute new scenario, then it starts working fine and it will behave just like any other successful executed interface.
    We are using only one LKM i.e LKM sql to sql. Also marked it as default LKM.
    I do not know why this is happening.
    Please suggest me solution for this problem.
    Thanks
    -Pallav

    Hi,
    Thanks for your answers, but it is still not what I expect
    In fact, I created a ZABAP process type and set the event to "Process ends "successfully" or "incorect"
    I used this how to guide to create the process type:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30664504-40dd-2a10-3794-db7b4190bef3
    For the Z program inside the variant I raise an error message when the condition is not verified. So I "want" the failure in some cases in the child chain and I want the next child chains to run in each case automatically in background.
    May be it is a bug, may be not...
    Thank you for your answers,
    Rgds,
    Edited by: Bruno Beckers on Dec 15, 2009 2:21 PM
    Edited by: Bruno Beckers on Dec 15, 2009 2:23 PM

  • Need help on ODI error table

    Hi all,
    I need to know following things
    1) I have created open few tools and if business validation fails it throws OpenToolExecutionException with some error code now I want to check in which SNP_ table it goes and how cud I track my error info.
    2)
    In other way where these error messages are stored when any scenario execution fails.
    snp_sess_task_log and SNP_STEP_LOG and SNP_SESS_STEP all are having
    one entry I_TXT_TASK_MESS in which table these messages are present
    3)
    Please let me know the names of scenario execution error tracking tables so that I can used them for notification purpose when any scenario fails.
    3)
    I want to know how operator showing this error code as I have inserted
    oracle.odi.sdk.opentools.OpenToolExecutionException: 5000
         at com.nucleus.acom.odi.opentool.tool.OdiProductTransferOpenTool.callOracleSP(OdiProductTransferOpenTool.java:240)
         at com.nucleus.acom.odi.opentool.tool.OdiProductTransferOpenTool.execute(OdiProductTransferOpenTool.java:124)
         at com.sunopsis.dwg.function.SnpsOpenToolFunction.actionExecute(SnpsOpenToolFunction.java)
         at com.sunopsis.dwg.function.SnpsOpenToolFunction.execute(SnpsOpenToolFunction.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.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.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)

    Hi Santos,
    Is it possible to use the same in OpenTool as I am invoking these steps one by one using invocation API.
    So in that case I wrote a java class as a controller and few Open Tool .
    * Condition is like we are executing steps one by one from that controller class .
    if the previous step caused exception then I use to stop all the other steps those are the successor of the same.
    * Open tool may throw some OpenToolExecutionException which depends on some businees validation and also some common java exception .
    how to use this API odiRef.getPrevStepLog() in my java code and where.
    could you please send me code for that one
    regards,
    palash Chatterjee

  • How to avoid Sequence Gapping in ODI Interface

    I have an employee table and a job map table in oracle based on the employee type/group and job type/group I need to pick up the sequence, generate id
    and update employee id of employee table using ODI
    employee table job table
    name type group id type group sequencename seqmin seqmax
    pat 1 1 1 1 seq1 1 10
    dan 1 2 1 2 seq2 30 40
    john 1 3 1 3 seq3 20 100
    when I select the sequence using if condition or case statement or decode and call the sequence <%=snpRef.getObjectName( "L" , "My_SEQ" , "D" )%>.nextval
    the sequences are creating gaps for every call.as the sequence is incrementing internally for every wrong mapping. How should I get rid of these gaps.
    In oracle database we call functions in the case condition.These functions consists of the seq.nextval code and the unwanted incremental gapping is avoided.
    But in the case of ODI how can we get this.
    Thanks,
    Vikram

    I am facing this issue when I execute on the source or staging area.When I try toexecute on the target,the ODI
    doesn't allow me to execute and gives the following warning
    "A mapping executed on the target cannot reference source columns. Move this mapping on the source or the staging area.     Target Column Employeeid"
    In my case I am using IKM Oracle Incremental update
    the source datastore is employee table, job table and target is copy of employee table(as i need to update the employee id column with sequence numbers by picking the right sequence from job table,sequence name column)

Maybe you are looking for

  • Sound not working in games and video!!

    Hey everyone, for some reason I can't get the audio to work in all of my games. The computer is hooked up to speakers and works but nothing plays in the game. I have the volume settings on and everything. Sometimes the music works but the sound effec

  • Rented HD movie on ATV in other language than English?

    I just tried out my ATV tonight with my first HD rental (HellBoy II...) and although the audio language setting was set to French, the audio was in English. I guess that the only audio available now is English and hope that it will come in a near fut

  • Flashplugin trouble on Intel GMA 3150

    Hi everyone. I have a trouble in playing video at full screen size. Screenshot: http://twitpic.com/4qmwkj/full How I can fix this trouble??? Thx.

  • How to Install Airport Extreme Utility Software on MacBook Air

    Here's my dilemma: I have an iMac G5 which I use with Remote Disk to install software on my MacBook Air. But when I try to use my new Airport Extreme install disk, I get an error telling me the software cannot be installed over a network. If I try co

  • What it the upper limit on metadata entries supported per metadata file in a file sync provider ?

    Hi All, I understand, Microsoft file sync provider metadata file is nothing but a Microsoft CE database, which cannot grow beyond 4GB. I also came to know that this metadata file is nothing but entries (aka details) of the files in the file system.