Need Example for AVG() function in script logics...

Hi Everyone,
                  I need to calculate average for all the account members ...
so if anybody worked with this AVG() in Script logics please share with me...................

What do you mean by calculate average? Average for the period or for some other parent or..? Where do you want to store this average? How do you want to use this average???

Similar Messages

  • SQL functions in Script Logic

    I want to build a script logic but the dimensions that I am testing do not have the fields I want in the format I want. In my case I would like to test the "Start" property in the Employee dimension. The property represents the employee start date but is a var char in the format dd.mm.yyyy rather thna a date field. I want to test whether it is five years prior to the date being processed.
    My time dimension has a year property and a monthnum property. Each of these are varchar. I can write SQL that would convert these to a date and compare them with the start property on the employee dimension.
    Can I  do iinsert SQL functions in the When statement. An example would be
    *When convert(datetime, substring(employee.start,4,2) + '/' + substring(employee.start,1,2) + '/' + substring(employee.start,7,4))
    Can I use  SQL functions in the Is statement? An example would be
    *Is <DateAdd(YY,-5 , convert(datetime, Time.Monthnum + '/01/'' + time.year)
    Finally when I use such techniques and look at the log by using "show log" in the logic debugger I see no reference to the SQL I used. It is as if the generated SQL has not made use of my functions. Instead all I seee are the extract statements from the three fact tables. Is this normal? Is there a way to see what SQL is really being generated and run?
    At the moment it seems my only option is to make changes, try running it and hope I get an output. If no records are written I can't be sure whether it is because embedding SQL function is not supported or because I have made some other error.

    No, the "BPC SQL" script logic doesn't allow for this extensive use of real SQL within the scripting syntax. As a concept, it's best to think of "BPC SQL" script logic as, "this unique BPC logic syntax will generate real SQL code when it's executed."
    There's very little real SQL that you can use within the syntax itself, and definitely not within the WHEN or IF statements.  Nothing like cast, convert, substring, etc. (Except you CAN use these, a little bit, in a *SELECT statement. But I don't see how that will solve your current problem.)
    Plus, when you consider how the logic engine processes a set of data, it's helpful to think of it in terms of selects & reading through a recordset. So in that regard, a SQL background can be helpful, in understanding the concepts. (Sort of helpful, except when it confuses you, or frustrates you since you don't have all the power you want.)
    Anyway, to solve your problem, you might be able to restate the problem, and then use something like this code, which is valid syntax:
    *WHEN TIME.TIMEID
    *IS >= VERSION.FirstPlanMonthTimeID
    In this case, FirstPlanMonthTimeID is set up in the version dimension as, for example, 20090400 (representing 2009.APR). This timeID is set by BPC automatically when processing the time dimension, and I need to ensure that my Version property value is set to match it.
    A key point is that in BPC fact tables, the time dimension is stored as TIMEID (not ID, unlike all the other dimensions), and can be used for comparative evaluation in script logic WHEN/IF. The comparison property needs to be stored as an 8-digit integer value. If your time dimension has days in it (along with months), check the TIMEID after processing, and you should see the pattern for assigning values to TIMEID for days and months, etc.
    Normally, TIMEID is assigned pretty sensible and stable values. If it doesn't meet your logic requirements, you can create another property (be careful of USERTIMEID, since that has a specific purpose in the system which I've never fully understood) and assign that whatever (integer) values make sense.

  • I need example for VARIABLES with Customer Exit.

    hi every body i need example for Variable for Customer Exit.

    Hi,
    You can define 'Formula' variables in your customer exit..for example..
    you need to calculate no of machine running hours per month, in order to
    caculate the machine total utilization time..in this context.. you need to know
    how may hours are there in an month by month..
    you can define a variable and write the code in the customer exit for deriving the total no. of hours available for that month and get that value into a variable for further calution like deducting the down time and set up time so on..in your
    calculated KF..
    Hope this helps..
    Assign points if useful..
    Cheers,
    Pattan.

  • Greater Than Function in Script Logic File

    BPC Experts,
    I've got a pretty simple script logic file to calculate salary amounts, overtime, etc.  The purpose of this logic is for forecasting.  I have two referenced dimensions, TIME and SCENARIO, where TIME.MONTHNUM is equal to its relative month number (eg: Jan monthnum = 1), and SCENARIO.CURRMONTH is equal to the relative amount of actual months data, (eg Jan currmonth = 0, Feb = 1) because if you are completing a February forecast, you have one month of actual.
    The ACTUAL scenario is never touched, but after a month closes, we copy the ACTUAL data to, for example, FEB_FCST.  So, after January closes, its actuals are copied to the FEB_FCST scenario so we can complete an actual/forecast (one month actual, 11 months forecast).
    Currently, the default logic skips anything in the ACTUAL scenario, by stating "*WHEN SCENARIO, *IS <> "ACTUAL" yada yada yada.
    However, when the default logic runs on the forecast scenarios, it takes the same inputs from the months that are copied over from the ACTUAL scenario and adds to the original amount, essentially doubling the value--ultimately causing an incorrect actuals number in the forecast scenario.
    My script right now looks like this:
    *XDIM_MEMBERSET DATASRC=INPUT
    *XDIM_MEMBERSET PRODUCT=NO_PRODUCT
    *XDIM_MEMBERSET SHIFT=NO_SHIFTS
    *XDIM_MEMBERSET MEASURES=PERIODIC
    *WHEN SCENARIO
    *IS <> "ACTUAL"
         *WHEN TIME.MONTHNUM
         *IS > SCENARIO.CURRENTMNTH
              *WHEN ACCOUNT
              *IS "SALARIED_MANPOWER"
                   *REC(EXPRESSION=((([ACCOUNT].[SALARIED_AVG_WAGE] * (1 + [ACCOUNT].[SALARY_TIMEAHALF]))* [ACCOUNT].[SALARIED_MANPOWER])),ACCOUNT="01100")
              *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    When it hits line 9 (*IS > SCENARIO.CURRENTMNTH) during validation, it errors.  How can I use a "greater than" function to dictate whether or not a given scenario should run default logic on a specific month?
    If not, is there a different/better way to do it?
    Thank you!
    ABF

    Hi Alex
    Take this sample logic, check the properties in your Time dimension to trouble shoot your issue.
    *SELECT(%CAT_VAR%, "ID", CATEGORY, ID= PLAN_APRIL)
    *XDIM_MEMBERSET CATEGORY = ACTUAL, PLAN, %CAT_VAR%
    *SELECT(%CATMTH%, "STARTMTH", CATEGORY, ID= %CAT_VAR%)
    *SELECT(%ACT_PERIOD%, "ID", TIME, MONTHNUM < %CATMTH% AND  LEVEL = MONTH AND YEAR = 2010)
    *SELECT(%PLAN_PERIOD%, "ID", TIME, MONTHNUM >= %CATMTH% AND LEVEL = MONTH AND YEAR = 2010)
    *XDIM_MEMBERSET TIME= %ACT_PERIOD%
    *XDIM_MEMBERSET CATEGORY=ACTUAL
    *WHEN CATEGORY
    *IS ACTUAL
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    *XDIM_MEMBERSET TIME= %PLAN_PERIOD%
    *XDIM_MEMBERSET CATEGORY=PLAN
    *WHEN CATEGORY
    *IS PLAN
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    Thanks

  • Math power function in script logic

    Hello all!
    Can anybody help me how  I can do math "power" function in BPC 5.1 Script Logic?
    Thanks

    Let's say you have a source account FOO and you want to calculate FOO to the 5th power, posting the result to FOOFIVE.
    In BPC SQL scripting, there are no mathematical functions to play with (powers, roots, sine, cosine, etc.) except for add, subtract, multiply and divide -- plus you can round results in your Factor or Expression. So that means, we must use multiplication.
    You could certainly do this using a bunch of intermediate accounts, one each for foo squared, foo cubed, foo to the 4th, and foo to the 5th. That would require *GO in between each *WHEN/REC block, and could be slow.
    I haven't tried this, but I think this should work, all in one statement:
    *XDIM_ACCOUNT = FOO
    *WHEN *
    *IS *
    REC(Factor=GET(Account="FOO")GET(Account="FOO")GET(Account="FOO")GET(Account="FOO")*GET(Account="FOO"),Account=FOOFIVE)
    *ENDWHEN
    If you want FOO to the 50th power, copy & paste.
    If you want square root of FOO, that could be a real challenge. I think to use straight BPC SQL logic it wouldn't be possible. I would probably write a stored procedure using SQL's SQRT(), and call that from the BPC logic file. Likewise for any other geometric functions, complex algebra, etc.
    There also may be a way to calculate powers in MDX -- that's more mathematically straightforward -- but as a BPC on MS person, I really never ever use MDX due to performance.
    Regards,
    Tim

  • Need help for the Function Module 'PFL_GET_PARAMETER_INFO'

    Hi Experts,
    The FM 'PFL_GET_PARAMETER_INFO'  returns the value for Profile Parameters for a system .
    The inputs required for this FM are :
      1.   Parameter name  : ( eg . login/min_password_lng etc. )                   
      2 . Parameter Type
    I am not sure about what the value of Parameter Type should be .
    Its a mandatory field.
    I have tried to search but could not find anything.
    Can you please help me on this?
    Thanks in Advance,
    Harshit Rungta
    Edited by: harshit rungta on May 27, 2011 8:15 AM

    What exactly is the use-case for this?
    Many developers "c-call" the params and neglect this feature of the type - also whether it is static or dynamic. Some params are even dynamic as system profiles in one direction but static as instance parameters in the other direction when changing the value.
    As you cannot create your own system profile parameters, I do not see the use-case for why you are wanting to check it in advance, because the application APIs should do this.
    What you are possibly looking for is function module SUSR_GENERATE_PASSWORD in this case. It will respect "the rules" in the params.
    Do not use the legacy function RSEC_GENERATE_PASSWORD directly.
    Cheers,
    Julius

  • Examples for using function modules and BApis.

    My Dear FRNDS,
    I am very new to ABAP. And I have read the documentation for  function modules but i am not that clear to practice them.So I would be very happy if u people share a little bit of ur experience with me.
    Please provide me some examples of all the use cases in function modules and specially exception handling.
    Frnds, i am going to work with bapis so i feel practicing function module will give me a edge.
    and please tell me after calling a BAPI FM why we have to perform   'BAPI_TRANSACTION_COMMIT' and 'BAPI_TRANSACTION_ROLLBACK'.
    .Ur efforts  will be greatly rewarded.
    thx,
    reshali

    Hi,
    Please check this sample codes.
    DATA: BAPI_Z05DOGI_DELIVERY LIKE BAPIOBDLVHDRCON-DELIV_NUMB ,
    BAPI_Z05DOGI_HEADER_DATA LIKE BAPIOBDLVHDRCON OCCURS 0 WITH HEADER LINE ,
    BAPI_Z05DOGI_HEADER_CONTROL LIKE BAPIOBDLVHDRCTRLCON OCCURS 0 WITH HEADER LINE,
    BAPI_Z05DOGI_ITEM_DATA LIKE BAPIOBDLVITEMCON OCCURS 0 WITH HEADER LINE,
    BAPI_Z05DOGI_ITEM_CONTROL LIKE BAPIOBDLVITEMCTRLCON OCCURS 0 WITH HEADER LINE ,
    BAPI_Z05DOGI_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE .
    CLEAR: BAPI_Z05DOGI_DELIVERY , BAPI_Z05DOGI_HEADER_DATA , BAPI_Z05DOGI_HEADER_CONTROL , BAPI_Z05DOGI_ITEM_DATA ,BAPI_Z05DOGI_ITEM_CONTROL , BAPI_Z05DOGI_RETURN .
    REFRESH: BAPI_Z05DOGI_HEADER_DATA , BAPI_Z05DOGI_HEADER_CONTROL , BAPI_Z05DOGI_ITEM_DATA , BAPI_Z05DOGI_ITEM_CONTROL , BAPI_Z05DOGI_RETURN .
    BAPI_Z05DOGI_DELIVERY = ZMM_WB1-ISSUE .
    BAPI_Z05DOGI_HEADER_DATA-DELIV_NUMB = ZMM_WB1-ISSUE.
    APPEND BAPI_Z05DOGI_HEADER_DATA.
    BAPI_Z05DOGI_HEADER_CONTROL-DELIV_NUMB = ZMM_WB1-ISSUE.
    BAPI_Z05DOGI_HEADER_CONTROL-POST_GI_FLG = 'X'.
    APPEND BAPI_Z05DOGI_HEADER_CONTROL.
    BAPI_Z05DOGI_ITEM_DATA-DELIV_NUMB = ZMM_WB1-ISSUE.
    BAPI_Z05DOGI_ITEM_DATA-DELIV_ITEM = 10.
    BAPI_Z05DOGI_ITEM_DATA-DLV_QTY = LFIMGGIA.
    BAPI_Z05DOGI_ITEM_DATA-SALES_UNIT = XTAB-MEINS.
    BAPI_Z05DOGI_ITEM_DATA-DLV_QTY_IMUNIT = LFIMGGIA.
    BAPI_Z05DOGI_ITEM_DATA-FACT_UNIT_NOM = UMVKZLIPS.
    BAPI_Z05DOGI_ITEM_DATA-FACT_UNIT_DENOM = UMVKNLIPS.
    APPEND BAPI_Z05DOGI_ITEM_DATA.
    BAPI_Z05DOGI_ITEM_CONTROL-DELIV_NUMB = ZMM_WB1-ISSUE.
    BAPI_Z05DOGI_ITEM_CONTROL-DELIV_ITEM = 10.
    BAPI_Z05DOGI_ITEM_CONTROL-CHG_DELQTY = 'X'.
    APPEND BAPI_Z05DOGI_ITEM_CONTROL.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
    EXPORTING
    DELIVERY = BAPI_Z05DOGI_DELIVERY
    HEADER_DATA = BAPI_Z05DOGI_HEADER_DATA
    HEADER_CONTROL = BAPI_Z05DOGI_HEADER_CONTROL
    TABLES
    ITEM_DATA = BAPI_Z05DOGI_ITEM_DATA
    ITEM_CONTROL = BAPI_Z05DOGI_ITEM_CONTROL
    RETURN = BAPI_Z05DOGI_RETURN.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPI_Z05DOGI_RETURN.
    Go thru this link
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    BAPI_TRANSACTION_COMMIT
    Execute external Commit when using BAPIs
    This method executes a COMMIT WORK command. It is required for
    transactions developed externally to the R/3 System that change data in
    the R/3 System via BAPI calls.
    When you call BAPIs in your program that change data in the R/3 System,
    afterwards you must call this method to write the changes to the
    database.
    COMMIT WORK
    The statement COMMIT WORK completes the current SAP LUW and opens a new one, storing all change requests for the currenta SAP LUW in the process
    there are some FM that we use for creating trasaction . for example FM : that use for creating production order . if you execut the FM , the system will not create any data in the system so you need to excute the FM : BAPI_TRANSACTION_COMMIT to commit that creating the production order .
    in case of commit work, that is a syntax in abap program . if you use this syntax after you insert ,update or delete table in the sap ,system will do it immediately otherwise the system will do it after execution is complete.
    ROLLBACK WORK.
    for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.
    Regards,
    Raj.

  • Need help for Conversion Function in Oracle

    Hi, Can Any One help me Please.
    I need a Oracle conversion script for converting from decimal to hex. and decimal to datetime.
    Thanks In Advance.

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Need procedure for the function

    Hi
    Can any one create a procedure
    for the following
    Following is a function i need a procedure
    which basically Converts the values in the a Column to no of rows
    Example : Column Name: USA; Canada; Japan;
    in to 3 rows : USA
    Canada
    Japan
    create
    or replace function f_get_row_vals(V_column_value VARCHAR2)
    return T_LIST_OF_VALS PIPELINED
    as
    n_str_length NUMBER := 0;
    N_START_CHAR NUMBER := 1;
    N_END_CHAR NUMBER := 0;
    n_counter NUMBER := 1;
    v_value VARCHAR2(50) := NULL;
    begin
    IF V_column_value IS NULL
    THEN
    RETURN;
    END IF;
    n_str_length := LENGTH(V_column_value);
    LOOP
    N_END_CHAR := INSTR(V_column_value,';',1,n_counter);
    IF N_END_CHAR = 0
    THEN
    v_value := SUBSTR(V_column_value, N_START_CHAR, n_str_length - N_START_CHAR + 1);
    ELSE
    v_value := SUBSTR(V_column_value, N_START_CHAR, N_END_CHAR-N_START_CHAR);
    END IF;
    n_counter := n_counter + 1;
    N_START_CHAR := N_END_CHAR + 1;
    pipe row(v_value);
    EXIT WHEN N_END_CHAR = 0 ;
    END LOOP;
    RETURN;
    END;
    Thanks

    This is the procedure they are using previously.
    This procedure is calling the above function. I need like this
    CREATE
    OR REPLACE PROCEDURE P_EXPAND_USER_ACCESS_REV_MART
    IS
    rec_ODS_USER_ACCESS_REV_MART ODS.ODS_USER_ACCESS_REV_MART%ROWTYPE;
    CURSOR c_getrows
    IS
    select * from ODS.ODS_USER_ACCESS_REV_MART;
    BEGIN
    OPEN c_getrows;
    LOOP
    FETCH c_getrows INTO rec_ODS_USER_ACCESS_REV_MART;
    EXIT WHEN c_getrows%NOTFOUND;
    DBMS_OUTPUT.put_line(rec_ODS_USER_ACCESS_REV_MART.wwfo_area);
    DBMS_OUTPUT.put_line(rec_ODS_USER_ACCESS_REV_MART.soln_division);
    INSERT INTO DW_USER_ACCESS_REV_MART
    user_id,
    wwfo_area,
    soln_division
    SELECT rec_ODS_USER_ACCESS_REV_MART.user_id,
    area_tab.column_vaLue,
    soln_tab.column_value
    FROM TABLE(CAST(f_get_row_vals(rec_ODS_USER_ACCESS_REV_MART.wwfo_area)AS T_LIST_OF_VALS) ) area_tab,
    TABLE(CAST(f_get_row_vals(rec_ODS_USER_ACCESS_REV_MART.soln_division)AS T_LIST_OF_VALS)) soln_tab
    END LOOP;
    CLOSE c_getrows;
    COMMIT;
    END;

  • Need example for BAPI query. Please, help.

    Hi,
    badly need help on BAPI_ACC_ACTIVITY_ALLOC_POST.
    Does anybody have some example code for jCO query?
    Thanks.
    Vladimir

    Hi,
    Try this code...
    package jco;
    import com.sap.mw.jco.*;
    public class jcosample
       public static void main(String args[])
           JCO.Client myConnection = null;
           JCO.Repository mRepository = null;
           JCO.Function myFunction = null;
           try
           myConnection = JCO.createClient("client","username","password" ,"language","ip address","system no");           
           myConnection.connect();
           mRepository = new JCO.Repository("WIPRO",myConnection);
           try
                  if (mRepository == null )
                         System.out.println("NuLL");
                  try
                         IFunctionTemplate ft=mRepository.getFunctionTemplate("BAPI_COMPANYCODE_GETLIST");                                                 
                         myFunction=ft.getFunction();                    
                  }catch (Exception ex)
                         throw new Exception(ex + "Problem retrieving JCO.Function object.");
            if (myFunction == null)
                     System.exit(1);
                  myConnection.execute(myFunction);                                  
                  }catch (Exception ex)
                         ex.printStackTrace();
                         System.exit(1);
                myConnection.execute(myFunction);
                JCO.Table codes = null;
                  codes =myFunction.getTableParameterList().getTable("COMPANYCODE_LIST");
                  int size;
                 size =codes.getNumRows();
                  if (size == 0)
                      System.out.println("No value matches the selection cretaria");
                  else
                     for (int i = 0;i<=size; i++)
                            codes.setRow(i);                      System.out.print(codes.getString("COMP_CODE"));                     System.out.println(codes.getString("COMP_NAME"));
           }catch( Exception e)
                  e.printStackTrace();
    Hope that helps...
    Note: in case for the BAPI that inserts or modified data you must call the BAPI_TRANSACTION_COMMIT also for the changes to get reflected in the Database.
    Please let me if that helps you.
    Cheers
    Kathir~

  • Need Assistance for VBA function in oracle how to implement

    My very respected and Senior, regards,
    Sir, hope you will in best of health and wealth by the grace of God,
    Sir, i have a request problem as i m very junior against you and you have passed this time before many years ago as i m standing where. Sir i m a very junior developer of oracle and have a problem putting on your desk with the hope that you can help my as a boss.
    Sir me have to calculate yield of Bond using oracle form
    i have tried my best and tired
    there is a formulae in excel which give the Yield() when we provide the parameters
    and i need the excel formulae or the oracle calculation code of PLSQL for this.
    How can i get yield when i have price, coupon rate, frequency, issue and maturity of the coupon , coupon period , next coming coupon , and others detail.
    or tell me how to use EXCEL VBA for this problem ,
    thnx n regards,
    yours student, junior developer youngest brother
    Faraz
    How can I get the solution using Excel VBA function with oracle
    so that move values to excel calculate them and copy the result from excel to oracle forms

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Using "left" mdx function in script logic

    Hello experts,
    I'm fetching a selection from a package prompt into a logic.
    The dimension name is ENTITYCC, so the variable name is %ENTITYCC_SET%.
    In this prompt user can select members from a hierarchy like that :
    CH20
    --- CH201000
    --- CH202000
    --- CH203000
    FR20
    --- FR201000
    --- FR202000
    --- FR203000
    and so on
    In my logic I need to have the parent node selected, but in case the user select a leave, I need to keep only first four caracters of his selection (to simulate the fact he select the parent)
    left(%ENTITYCC_SET%,4)
    What would be the instruction to get in another variable only the first four caracters of %ENTITYCC_SET% ?
    Thanks for your ideas.
    G.

    Solved by myself, sorry for the useless post.
    (my solution is :
    *SELECT(%ENTITY%,"left([ID],4)","ENTITYCC","[ID] = '%ENTITYCC_SET%'")
    and remember to use lgf file and not lgx when there is mdx in the logic

  • Need examples for non-linear optimization

    In the mathematics - optimization section there is a VI which is..... unconstrained optimization
    I am using the downhill simplex option and the input that describes the objective function is "another VI" which I will create.
    Are there any examples on how to use this VI since I am not sure how to use the "objective function" input which is a reference to another VI and how to set up the "function data" input either (i.e do you use it specify constants ???? how do you do this ????)

    Hi sammy,
    You can find more information about this command by right-clicking on the VI and choosing Help. You can then choose the Downhill Simplex option for a detailed description of how to use this VI. The following information is provided in the Help about the "objective VI" you must build:
    objective function is a reference to the VI that implements the
    function to optimize. Create this VI by starting from the VI template located at
    labview\vi.lib\gmath\NumericalOptimization\ucno_objective
    function template.vit.
    Also, more help information can be viewed here:
    Downhill Simplex nD (Not in Base Package)
    I didn't find an example program in our Developer Zone, but you might be able to find one by searching the Discussion Forums.
    Hope this helps!
    Amanda Howard
    Americas Services and Support Recruiting Manager
    National Instruments

  • Need expression for lookup function

    I need a lookup function:
    Tablename: Tbl_orders
    Fieldname to check OrdID = 1709 then make it 7001709 else keep numbers same.
    Thank you very much for the helpful info.

    For a lookup function, you'll always have a compare column (Column in the lookup table) and compare expression (Expression to which the compare column is compared to).
    If you nest the lookup in decode / ifthenelse, the expression will be hard to maintain like:
    decode(lookup(<DataStoreName>.Tbl_Orders, OrderID, 0, 'PRE_LOAD_CACHE',Compare_Column in Tbl_Orders, Compare expression with compare column) = 1709,lpad(lookup(<DataStoreName>.Tbl_Orders, OrderID, 0, 'PRE_LOAD_CACHE',Compare_Column in Tbl_Orders, Compare expression with compare column),7,'700'),lookup(<DataStoreName>.Tbl_Orders, OrderID, 0, 'PRE_LOAD_CACHE',Compare_Column in Tbl_Orders, Compare expression with compare column))
    But, I believe you do not want to make the code this complex.
    Do the lookup in one Query transform (either you can add as a function in the output schema or add it in mapping tab) and get the value in one Query transform.
    lookup(<DataStoreName>.Tbl_Orders, OrderID, 0, 'PRE_LOAD_CACHE',Compare_Column in Tbl_Orders, Compare expression with compare column)
    In the next Query transform, do an lpad / direct hardcoding inside ifthenelse / decode.
    decode(Order_ID = 1709,lpad(Order_ID,7,'700'),Order_ID)

  • Need advice for System_mail_send function..

    I am utilizing the System_mail_send function to send Spool reports via email. I now have 2 questions:
    1) Can System_mail_send support multiple attachments? For example, I hope it can attach the Spool file and the Log file all together in one email. Is this possible?
    2) About the Text field where can input some words in the email content. How to switch lines. I think it's too stupid to insert a bunch of 'space'. Anything like <br> in HTML can do this job?

    Right click Job Definitions on the left navigation tab and create New Job definition. When prompted, select Mail type and click Create.
    Now provide the HTML coding for your mail format inside the job definition and for dynamic values like Job definition, you can pass them from another job definition.
    You can attach the files by mentioning the filename under the [Attachments] .
    For this you must explicitly provide permissions to the directory where the files are stored in the server.
    I recommend following the admin guide, which has clear examples.
    thanks
    Nanda

Maybe you are looking for

  • Special Ledger: Open Line items are not being loaded in BW

    Hi all. We are loading Special Ledger information from R/3 to BW, and for many accounts, the data is not reconciling between the two systems. We have found out that none of the Open Line Items are being transferred. Do you know which could be the cau

  • Possible Hard Drive Issue?? How to test?

    I recently upgraded to Leopard this weekend, seems to be running "snappy" in some parts, but I might have an issue with HD possibly reading slow. Sometimes when I do certain functions (open certain files or programs) I get beachballing. This is the s

  • ORA errors in PDF file

    Sir, I have the ORA-ERRORS in .pdf file, but the version is for Oracle 8i database. Someone knows where can I find this file but up to date for Oracle 9i or 10g ? Thanks

  • HT200154 How do I turn off my apple tv?

    How do I turn off my apple tv?

  • Pay structure consistency across employee, position, job

    Hi I want to create an ad-hoc report with employee pay structure (pay type, area, group, level) on IT 0008 and their position pay structure on IT 1005 and job pay structure on IT 1005. Any suggestions will be highly appreciated. Manish