Import of Jython Script if Stmt

I have a Jython import the script I'm debugging.  I proved that everything works properly until my if stmt.  That's what I want to do... If the DR_str field is null, then returns the CR_str field; otherwise the return DR_str field.

This script in its current state will import all records where DR_str is not null.  He will ignore the fields where the DR_Str is null

def AMOUNT_CSV_12 (strfield, strrec):

arrRecords = strrec.split(',')

DR_str = arrRecords [12]

CR_str = arrRecords [13]

If DR_str is None or DR_str == "or DR_str == 0:

End_str = float (CR_str)

Another thing:

End_str = float (DR_str)

return End_str

Hi 898555,

The return statement is indented in this clause else for now so it'll never return a value for End_str, when the else clause works. This cut from the version of your function to the return in four spaces returns 9999.0

def AMOUNT_CSV_12():

DR_str = 0

CR_str = 9999

If DR_str is None or DR_str == "or DR_str == 0:

End_str = float (CR_str)

Another thing:

End_str = float (DR_str)

return End_str

Tags: Business Intelligence

Similar Questions

  • FDMEE Jython Script help

    My load the import data were thrown a curve ball. I used to have a 1 or 2 digits in the card. If it's a digit, I simply added a zero at the beginning (i.e. FillL convert 1 01). But now I have a leader 4 digits and a hyphen. So instead of '1', I have 2500-1, instead of "12", I now 2500-12. I need to remove what is to the right of the dash and then add a zero not significant if it is not already 2 digits. Does anyone know the script that would achieve this?

    Your help is very appreciated.

    FA

    Hello

    You can create this jython script and assign import format:

    def customFill (strField, strRecord):

    return ('0' + strField.split("-") [1]) [-2:]

    This function divides your strField using "-" as the delimiter, then him concatenate '0' with the second element ([1] in the table starts in position 0) and finally to take the last two characters [-2:]

    If you have 1 number after the hyphen you will get 0 x. On the other hand, if you have already a 2-digit, you will get xx

    Hope says.

  • FDMEE mapping < white > does not / Jython Script

    Hi all

    Has anyone got the < white > mapping work?  I put it in my SIMILAR mapping and it does nothing.  Any help would be appreciated.

    As a solution, I tried to add an import script to my base file import format.  I want it all empty fields in PKI to convert in [no PIC].  Keep logs process details (see below) gives me an error.  He doesn't seem to like dealing with NULL values.  Here is my script to import of Jython:

    def OracleEBS_ICPNone (strField, strrecord):

    If strfield is not nothing and len (strfield) > 0:

    return "[ICP None]"

    Another thing:

    return strfield

    Error log:

    2014-06-03 14:57:18, 892 [AIF] DEBUG: 105039:EPMERPI - error expression evaluation: OracleEBS_ICPNone (", 725, 100151_C, 000, 16434308.16')

    result: null

    2014-06-03 14:57:18, ERROR 894 [AIF]: 105039:EPMERPI - 105042:EPMERPI - error evaluating script.

    null

    THX,

    Mike

    How are your values of source?

    does not refer to NULL.

    This will work only if the value of your source has a blank space.

    So if you have a map as --> [no PIC]

    and your source is an empty string... it won't

    It won't work if it has a white space (' ')

    For you the script:

    def OracleEBS_ICPNone (strField, strrecord):

    If strfield is not nothing and len (strfield) > 0:

    return "[ICP None]"

    Another thing:

    return strfield

    Jython is case-sensitive: strField <> strfield

    If you want to capture values empty source in PKI:

    def OracleEBS_ICPNone (strField, strRecord):

    # You can cut your source, remove the whitespace on the left/right and then check if the length is zero

    If len (strField.strip () == 0:

    return "[ICP None]"

    Another thing:

    return strField

  • Is it possible to place a clip imported chronology by script or plug-in?

    Is it possible to place a clip imported chronology by script or plug-in?

    I can't find any indication as to the control of a clip on the timeline.

    The example PProPanel demonstrates how to drag and drop a file reference in the Panel, in the project Panel or in a timeline.

  • Import and XMLImport Script

    Hello

    I have a confusion about importing and XMLImport script
    We can use XMLImport and the two Import Script to load the page definitions IE the XML file. in MDS


    What is the diff between them based on their uses?

    Thanx

    Import command is usually run from the premises it IE prompt CMD and importing XML we run unix server.

    Thank you
    -Anil

  • How to assign the value to the variable of project in the Jython script

    Hello

    I want to assign a value to the variable of project in the jython script.
    I tried to assign the following, but it is throwing some errors.

    < @.
    int noOfRecords = 10;
    #var1 = noOfRecords;
    @ >


    Can you please help me in this regard.

    Concerning
    Shyam

    Perfect! Good to know that!

    Please, don't forget to close the thread and assign the status to 'correct' or 'comfortable' to each response that helped you!

    Thank you

    Cezar Santos
    http://odiexeperts.com

  • FDMEE import Jython Script - field Split function

    Hi people,

    I have to admit, this Jython gives me a heavy headache!

    In fact, it's a simple mistake, but I'm fighting around with it for hours now. Maybe one of you guys can help.

    I want to create a Script of Import in FDMEE 11.1.2.3.500.17. The source file (separator: tab) contains a column with the following entries:

    Capture1.JPG

    What I want to achieve at first is to import the figure after the first point. For example, hours - 00275. 3. 4.1 I want to import 3.

    I wrote a script to import, based on an example of written script in FDMEE admin guide (page 273):

    Capture2.JPG

    I assigned this script to the respective column in the Import Format:

    Capture3.JPG

    Seems easy. But for some reason, it does not. The problem is: even the log file is not help, because it seems to be growing constantly when I want to open it (after becoming 30 MB I cancelled). By the way: without this script works import.

    Any ideas? Help is very appreciated!

    See you soon

    Carmonte

    I wasn't talking about the script file extension, as you say is irrelevant, your file name of the script was eGRCcISPA (without the extension) and your function called eGRCsISPA (in the body of the script). They were different and should be the same. They are the same today? Also when you say that this does not work, what do you mean?

    (1) import runs successfully, but represented for that field values are not what you expect the rest of the script is running?

    (2) the mistakes of import process when using that import format?

  • Jython script analysis on commas

    I use an import script to import a file with records similar to the one below.

    Entity, CR_Amt, DR_Amt, Custom1, account

    ' 100 ',' 2000 ',' 300 ',' 17,000,000.00 ',.

    '400', '5000', '600', '28,000.00.

    My script is on the DR_Amt and CR_Amt fields is as follows:

    def AMOUNT_CSV (strfield, strrec):

    arrRecords = strrec.split(',')

    strDr = arrRecords [4]

    strCr = arrRecords [5]

    dr_str = strDr.replace('"','')

    Cr_str = strCr.replace('"','')

    If dr_str is None or dr_str == "" or dr_str == 0:

    End_str = floating fenΩtre (Cr_str) *-1

    Another thing:

    End_str = float (dr_str)

    return End_str

    The script seems to work fine except that it scans my fields amount on the comma separator.  For example, the first record will return at 17.00 and the second field will return 28.00.  Is there a way to get around this?

    It seems that regular import module expression or csv import scripts does not work correctly...

    Python/jython is very powerful, you might also have a solution using list function for a list of positions for the character "and then get the amount of CR based on the last two positions.

    def parseDoubleQuotesDRCR (strfield, strrec):

    If strfield is None or strfield.strip () == ' ' or strfield == 0:

    # Sample line-> ""400","5000","600","28,000.00.

    # Get a list of the positions of the characters in double quotation marks

    # Ex: [0, 4, 6, 11, 13, 17, 20, 30]

    listposquotes = [i i, in enumerate (strrec) so ltr ltr == "'"]

    "# Get the position of the first character after the double quotes after the last '.

    # CR is stored between 20 and 30-> strrec [21:30]

    crstart = listposquotes [(len (listposquotes)-2)] # + 1 post 21

    crend = listposquotes [(len (listposquotes)-1)] # 30 Position

    Separator to replace thousands of # to avoid conversion problems

    amount = float (str(strrec[crstart:crend]).replace (',', ")) *-1

    Another thing:

    quantity = float (strfield.replace(',',''))

    return the amount

  • Jython script to remove the quotes

    All,

    I created the following script as an event script before import to remove the quotes around member names in our source file.  Everything seems to work except the last step of deleting and renaming the file (os.remove and os.rename).  I can see the ".out" file and it seems OK, but the original file is still there.  Any help is greatly appreciated.

    If fdmContext ["LOCNAME'] == 'TecLabor_TO_RSA ':

    fdmAPI.logInfo (fdmContext ["LOCNAME"])

    Try:

    filename = fdmContext ["FILENAME"]

    Inbox = fdmContext ["INBOXDIR"]

    #filedir = fdmContext ['FILEDIR']

    fdmAPI.logInfo (filename)

    fdmAPI.logInfo (inbox)

    file = inbox + '\\TecLabor_TO_RSA\\' + filename

    file_out = inbox + "\\TecLabor_TO_RSA\\" + file name ".out".

    #file = inbox '-' + filedir + "\\"+filename. "

    #file_out = inbox + "\" + filedir + "\\"+filename + «.out "»

    fdmAPI.logInfo (file)

    end = open (file, "r")

    who cares = open (file_out, "w")

    for the end line:

    Line = Line.Replace ('"'," ")

    care. Write (Line)

    end. Close()

    care. Close()

    except IOError, err:

    fdmAPI.logError ("My error" + str (err))

    OS. Remove (file)

    OS. Rename (file_out, leader)

    So you're saying that the os.rename and os.remove of commands do not work? If so make sure have included you the following import statement at the top of your script - import bones

  • How to use a SELECT QUERY using fdmAPI.executeDML in the Jython Script FDMEE?

    Hello

    Is just the way we use DELETE and INSERT statement using fdmAPI.executeDML, possible to run a SELECT statement and get the result in the variables?

    I want to refrain from using import java.sql and enter the connection information in a script. I would rather use SELECT directly if possible. I want to read the TDATASEG. DATAKEY column and use it for some custom in a custom table process

    Thank you!

    Try RS.next instead of RS. Next

  • Import an .eps script?

    Hi all

    I use InDesign CS6 and need help with a script (JavaScript)

    I do the exactly the same as this previous discussion below, MathType equations exporting the Word as EPS files and then trying to put them in my indesign file.

    Batch import eps equations in Indesign

    For this discussion, is there a better script or method to import .eps files? (see screenshot below)

    I placed my Word file in InDesign. EC that, in my view, this script is supposed to do is to replace all the files names @Equ021.eps @ with these images in the path to the line 23

    Here is the script I use and all I had to do was apparently save my script after I registered the name of path to line 23. (The person who gave me is no longer works with me, so I'm on my own)

    When I try to register, I get the error:

    error.png

    I am very new to scripting so that means this error below, and what I need to do to fix?

    scrpit.png

    Thanks for any help! I have thousands of these equations and do not want to import one by one.

    Hi Colleen,

    Please change the "Adobe Indesign CS6" target when debugging your script manually or add the threshold at the beginning of your script.

    indesign #target

    Otherwise, there may be error due to save the file in the location suitable because of the issue of access. If so, then try to place the script somewhere and try it.

    If this does not resolve your problem, let me know what he throws.

    Kind regards

    K.Velprakash

  • FDMEE Jython scripts

    I use fdmContext ['PERIODKEY'] to pull in the PeriodKey and she returned to 2013-11-18 (AAAA-MM-JJ), and I would like to change the format of 201311 (YYYYMM).  Something there suggestions on how this can be accomplished using Jython?

    Thanks in advance.

    Try

    import of java

    print java.text.SimpleDateFormat("yyyyMM").format (java.util.Date ())

  • the issue of conversion of character when you import application with script sets.

    Our database has character defined: WE8MSWIN1252

    We have an area with the following title: copying. The e is stored as character 235 in the database.
    When I do a request export file is in UTF-8 format. The e is now stored as hex C3 AB in this file.
    When you import the application by using the tool of the Apex, the e is still stored as character 235 in the database.

    In our installation script, we use a code to load the application. It looks like this:
    declare
       ...
    begin
       -- Determine workspace ID
        ...
       apex_application_install.set_workspace_id(l_workspace_id);
    
       -- Determine app ID
       ... 
       apex_application_install.set_application_id(l_app_id);
    
       apex_application_install.generate_offset;
    
       apex_application_install.set_schema(l_schema);
       apex_application_install.set_application_alias(l_schema);
    
       l_app_id := apex_application_install.get_application_id;
    end;
    /
      
    @..\apex\f200.sql
    It works fine except that no game conversion takes place. The UTF-8 character is placed in the database so that our region has the title: Kopia "ren".
    Is there a way to fix this?

    Hi René,.

    The character of your local NLS_LANG environment variable set part should be AL32UTF8, and this must be set before you import your request via SQL * more.

    Joel

  • import of HBR scripts, projects, Macros using LCM is not CRUSH existi

    Hello
    I have heard complaints from others about this problem with LCM:
    HBR scripts, projects, Macros using LCM import does not OVERWRITE the existing scripts to the target server.
    I was able to work around this problem by deleting all the HBR of target components before you import it using LCM.
    I had to tip LCM by importing scripts first and then import macros. Finally, I imported the sequences and projects.
    Unfortunately, the content of the sequences is lost, but the sequences are imported into the target. Also, security on the project are lost.
    Someone else finds a better solution to workaround?

    PS. I tried to bypass LCM problem using Export/Import of EAS of HBR. There was import scripts HBR error messages; I have no problems with migration scripts HBR using LCM. LCM is better than export HBR.

    Published by: Fan of Essbase on April 25, 2010 16:06

    Hello

    There has always been a lack of features when it comes to import business rules, using EAS, you always had to be removed first because it is not overwrite functionality.
    I used LCM to import rules and I thought they would have built in functionality to crush, but even if it says that the import was successful nothing gets crushed.
    I doubt they will any change like Oracle customers down the road Manager of Calc.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • GB Pound sterling symbol £ import from a script

    Apex v3.1.2.00.02

    I'm migrating a large application to a new network.

    I exported the original app from the old network of Unicode UTF-8 character. I have since done a lot of development work on the application on the new network for purposes of curing.

    Now, my problem comes when I try to export the new network application (for transport to test and live environments). The application has a large number of "£" (GB pound sterling) signs that are hard-coded in the text and the column headers.

    When I export demand, all signs of £ change to A £

    I think it's a question of character, but I do not get an option to change the character at the export... it is in Unicode UTF-8.

    I tried to find and replace in the source code exported corn (which I know is not supported), which eventually produced another funny character (a diamond with a? the middle of it) instead of the symbol £.

    Does anyone know how to fix this?

    Thanks in advance,
    Gus...

    Gus,

    Get ready for this question to answer and let me pick up points.

    + > If I import the application using our automated (below) migration script, the characters are NOT interpreted correctly, we get +.

    If it imports correctly the Web interface of the APEX, but it fails when importing through SQL * Plus, and then in your case this means that your NLS_LANG environment variable is not correctly set before calling SQL * more. The set of characters part of it must be AL32UTF8.

    Joel

Maybe you are looking for

  • printers HP officejet j4550: hp officejet j4550 printer all in one

    I have upgraded to windows 10 on my laptop. I have an hp officejet j4550 all-in-one printer. I used the boot disk and received a message that my system does not meet the requirements. This printer works on windows 10? What should I do?

  • 4003dx spectrum HP X 360: size of spectrum HP X 360 4003dx pine

    What size of tip works with spectrum HP X 360 4003dx?

  • Tecra M3: Change the English a German keyboard, a

    Hello I received a Tecra M3 with an English keyboard, although we are located in Germany. Indeed, this makes a little difficult to deal with the German special characters. Is it possible to simply exchange the keyboard by a German? And, if so, how mu

  • Satellite A660-149 - has a 3D video card?

    My laptop has been a surprise gift for me--day after day, I now discover its many wonderful features. A bit of a struggle of ' cos I am not be well versed in the calculation. Is something I'm unsure: is my NVidia GeForce 3d video card? I'd be better

  • Opportunity iPhone 5

    I got an iPhone 5 my friend (its an old).  I'm trying to set up my son but I get the "a password is required to activate this device because its owner has used find my iPhone to establish links with their Apple ID.  I talked to my friend and he signe