Extracting and Sorting a Number in a Text field

Hi everybody,
I have a column in LOAN_DTL Table as LOAN_DESC which contains data like this:
   CUSTOMER LOAN A/C : CAR  10.00%
   CUSTOMER LOAN A/C : CAR 11
   CUSTOMER LOAN A/C - HOUSE 15.5%
   CUSTOMER LOAN ACCOUNT - CAR 5.50%
   CUSTOMER LOAN A/C - CAR 9%
   CUSTOMER LOAN ACCOUNT : HOUSE 10%
   CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
   CUSTOMER LOAN ACCOUNT : HOUSE 7.75
   CUSTOMER LOAN A/C : HOUSE 6.00
From the above data, I need to extract the Group i.e. CAR, HOUSE etc. and sort the Group on Rate of Interest order as below :
          CUSTOMER LOAN ACCOUNT - CAR 5.50%
          CUSTOMER LOAN A/C - CAR 9%
          CUSTOMER LOAN A/C : CAR  10.00%
          CUSTOMER LOAN A/C : CAR 11
          CUSTOMER LOAN A/C : HOUSE 6.00
          CUSTOMER LOAN ACCOUNT : HOUSE 7.75
          CUSTOMER LOAN ACCOUNT : HOUSE 10%
          CUSTOMER LOAN A/C - HOUSE 15.5%
          CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
How to go about the above ?

Like this?
SELECT loan_desc,REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+%?') extract_string
FROM loan_dtl
ORDER BY 1,
         DECODE(loan_desc,
                loan_desc,
                TO_NUMBER(REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+')));
Message was edited by: 000000

Similar Messages

  • Using variables to add and subtract a number in a text field?

    The adding bit works fine:
    // get this pconn count
    var this_p_conn:Number = Object(this).parent.p_conn;
    // get current pconn total
    var c_this_p_conn:Number = Object(root).part_count.p_conn_count.text    
    // add this pconn count to total pconn
    var v_this_p_conn:Number = Number(this_p_conn+c_this_p_conn);
    // Update total pconn with new value
    Object(root).part_count.p_conn_count.text = String(v_this_p_conn)
    Removing a value from the total is another story, this looks like it should work but it does not:
    // get this pconn count
    var count_p_conn:Number = Object(this).parent.p_conn;
    // get current pconn total
    var total_p_conn:Number = Object(root).part_count.p_conn_count.text;
    // subtract this pconn count from total pconn
    var new_p_conn:Number = Number(total_p_conn-count_p_conn);
    // Update total pconn with new value
    Object(root).part_count.p_conn_count.text = String(new_p_conn);
    Any ideas or suggestions? My eyes are a bit blurry from looking at code, maybe I missed something obvious. Thanks in advance!

    Never mind, I got it worked out now.
    I had the subtraction code firing AFTER my remove self code, so the player never got to fire the subtract code:
    var b:MovieClip = Object(this).parent;
    Object(this).parent.parent.removeChild(b);
    I placed the subtract code before the above code and now it works fine... I think I need powernap...
    The lesson here is that apparently code fires from the top to the bottom, mind the order of how your code is stacked.
    Sorry for the fuss! Carry on.

  • Fill BSEG-LIFNR and LFA1-NAME1 in line item text field of Bank GL line item

    Hi all,
    I need to develop a program to populate the Vendor Number (BSEG-LIFNR) and Vendor Name (LFA1-NAME1) in the line item text field of Bank GL line item.
    The UI design will have the input data as:
       - Company Code
       - Posting Dates (both from and to date)
       - Execute Icon
    Please let me know how to proceed on this.
    Thanks and regards,
    Anishur

    program a bdc to tcode fb09
    A.

  • Verifying if number in a text field will evaluate to a date format

    I have a field, FieldA, that contains 6 numbers, (although the field is a text field). I need to know if that field's numbers evaluate to a true date in the format of mmddyy. For example, if FieldA contains 060110, then that would evaluate to a true date of 6/1/10. However, if FieldA contains 130110, then this is not a valid date and the test will indicate accordingly. I was thinking of using a case statement, but unsure of how to test if the numbers evaluate to a valid date..
    Sort of:
    CASE WHEN FieldA = 'Valid Date' THEN FieldA TO_DATE(FieldA, 'mm-dd-yyyy')
    Any help is appreciated..
    Thanks..

    user12296489 wrote:
    I have a field, FieldA, that contains 6 numbers, (although the field is a text field). I need to know if that field's numbers evaluate to a true date in the format of mmddyy. For example, if FieldA contains 060110, then that would evaluate to a true date of 6/1/10. However, if FieldA contains 130110, then this is not a valid date and the test will indicate accordingly. I was thinking of using a case statement, but unsure of how to test if the numbers evaluate to a valid date..
    Sort of:
    CASE WHEN FieldA = 'Valid Date' THEN FieldA TO_DATE(FieldA, 'mm-dd-yyyy')If fielda contains '060110' (meaining June 1, 2010), then you want to use 'mmddrr' as the 2nd argument to TO_CHAR, not 'mm-dd-yyyy'.
    Any help is appreciated..The following thread has a couple of different solutions:
    Re: how to select valid dates only

  • Number of visible text fields

    Hi all,
    Trying to upload document numbers from Excel into SAP via transaction F-03 using SAP GUI Scripting.
    My approach is to enter values one by one and press Enter when the last visible text field is reached. Then enter another batch of values, press Enter and so on..
    The problem is that I do not know how to get that event when the last visible field is reached.
    I know the solution but for tables when you can count a number of visible rows (.visibleRowCount).
    Thanks in advance.

    Hi Dmitry,
    in this case, I would proceed as follows:
    1. before the position command the system error handling switch off with
    on error resume next
    2. behind the position command the test of error number with
    if err.number < 0 or err.number > 0
    For example:
    on error resume next
    err.clear
    'position command from existing script
    if err.number > 0 or err.number < 0  then
    'processing . . .
    end if
    on error goto 0
    Declaration on the solution: In a non-relevant line will it not work. This one can evaluate it.
    Regards,
    ScriptMan
    Edited by: ScriptMan on Apr 19, 2010 7:36 PM

  • CreateTextField and _height: Problem with Placement of Text Fields

    I'm using createTextField to create several text fields
    dynamically. I'm also using an external XML file and a style sheet
    to populate the text fields.
    My problem is that I'm trying to position the various text
    fields on the page so that they are spaced evenly on the page
    (regardless of how much content they might contain). I'm trying to
    use _height of the prior text fields to place subsequent text
    fields, but I'm getting very inconsistent results. When I trace the
    value of _height, I get differing results, even if I don't actually
    change any of the parameters. So, the question is...is there a way
    for Flash to get the height of a dynamically created text field
    that's populated via an exteral XML file and using CSS? I know
    that's asking a lot, but I'm trying to avoid using scroll bars if
    at all possible.
    Thanks for any pointers.
    Bill

    i assume you're using multiline textifields with a fixed
    width and autoSize="left".
    flash will report the correct _height of your textfields IF
    you access the _height property after your htmlText has been
    assigned to your textfield. ie, you're probably seeing inconsistant
    results because you're not waiting until all data needed to
    populate your textfield has loaded.

  • When click on button - Number in a text field increase by 1

    Hello!
    I have no coding experience and want to create a game like Cookie Clicker. An idle clicker game.
    So I have my button and a text field which says "0$". How can I make it, that when I click on the button the "0$" turns to "1$" and so on... ?
    I use Actionscript 3 as a file type, I hope this is correct.
    I hope someone will help me.
    Greetings!

    I will mark your answer when it works. Now I get no error report, but when I start the game its like this:
    When I click on the button its like this:
    When I click again on the button, it is only the $ symbol again and it doesn't change after.
    Can I send you my file somehow, so you can check?
    Thanks for all your help so far!

  • Extracting and sorting AVCHD Clips

    I just got a Panasonic Lumix GH3 camera. I took shots for several different projects all on the same SD card. I want to separate the clips into the corresponding project folders on my computer so that I can label the clips and import and edit them later in Premiere. When I insert the SD card, I click on private and the AVCHD file. I dragged and dropped the whole file onto myu desktop and then opened it. I then tried to drag and drop the individual files to the folders, but it doesn't work. I don't want to import the whole file into Premiere because the clips are from several different projects. How can I extract the clips out to sort them before working with them in Premiere?

    Like this?
    SELECT loan_desc,REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+%?') extract_string
    FROM loan_dtl
    ORDER BY 1,
             DECODE(loan_desc,
                    loan_desc,
                    TO_NUMBER(REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+')));
    Message was edited by: 000000

  • Incrementing a Number in a Text Field by Holding a Button

    Hi All,
    Just wondering... is there any way to increment a display number up or down my clicking / holding a button?
    im making a project to select a fuel tank capacity and want the default to be 0.0 gallons and have the user increase the number or decrease the number by clicking and up or down arrow button... If they hold the same button that function would ideally increment faster, perhaps by multiples of ten until it reached a max / min number.
    Thank you for any help... i have no idea where to begin.
    Pat

    if tf is your textfield and you use movieclip buttons:
    btn1.change = .1;
    btn1.onPress=function(){
    this.onEnterFrame=editTF;
    btn1.onRelease=function(){
    delete this.onEnterFrame;
    btn2.change = -.1;
    btn2.onPress=function(){
    this.onEnterFrame=editTF;
    btn2.onRelease=functino(){
    delete this.onEnterFrame;
    function editTF(){
    tf.text = this.change+Number(tf.text);

  • Data Extraction and ODS/Cube loading: New date key field added

    Good morning.
    Your expert advise is required with the following:
    1. A data extract was done previously from a source with a full upload to the ODS and cube. An event is triggered from the source when data is available and then the process chain will first clear all the data in the ODS and cube and then reload, activate etc.
    2. In the ODS, the 'forecast period' field was now moved from data fields to 'Key field' as the user would like to report per period in future. The source will in future only provide the data for a specific period and not all the data as before.
    3) Data must be appended in future.
    4) the current InfoPackage in the ODS is a full upload.
    5) The 'old' data in the ODS and cube must not be deleted as the source cannot provide it again. They will report on the data per forecast period key in future.
    I am not sure what to do in BW as far as the InfoPackages are concerned, loading the data and updating the cube.
    My questions are:
    Q1) How will I ensure that BW will append the data for each forecast period to the ODS and cube in future? What do I check in the InfoPackages?
    Q2) I have now removed the process chain event that used to delete the data in the ODS and cube before reloading it again. Was that the right thing to do?
    Your assistance will be highly appreciated. Thanks
    Cornelius Faurie

    Hi Cornelius,
    Q1) How will I ensure that BW will append the data for each forecast period to the ODS and cube in future? What do I check in the InfoPackages?
    -->> Try to load data into ODS in Overwrite mode full update asbefore(adds new records and changes previous records with latest). Pust delta from this ODS to CUBE.
    If existing ODS loading in addition, introduce one more ODS with same granularity of source and load in Overwrite mode if possible delta or Full and push delta only subsequently.
    Q2) I have now removed the process chain event that used to delete the data in the ODS and cube before reloading it again. Was that the right thing to do?
    --> Yes, It is correct. Otherwise you will loose historic data.
    Hope it Helps
    Srini

  • Extract Year (only) from Date Field and Display in Text Field

    I need to extract the year from a user entered date field and display the year in a text field. Can someone help me with the correct script to do this?

    Hi,
    that's quite easy to realize with FormCalc.
    In you date fields exit event add the following code:
    textField1 = Num2Date( Date2Num($.formattedValue, "MM/DD/YYYY"), "YYYY")
    Note: This sample assumes that your date field formats the date with "MM/DD/YYYY". You may have to change the pattern to make it work at your end.

  • How To: Extract first three characters of a text field

    Greetings --
    What is the best method for extracting the first three
    letters of a text field?
    I need to extract the first three letters of a text field (in
    this case Last Name),
    so I add it to other components so as to create an
    identification number for
    a person.
    This identification number that needs to be created is
    comprised of the
    person's date of birth, last 4 numbers of the social security
    number and
    the the first three letters of the person's last name.
    Example:
    ==> Birthdate: 11/15/45
    ==> Last 4 SSN: 6654
    ==> Last Name: Smith
    ID Number would be:
    ==> 1115456654SMI
    Leonard B

    That should do the trick:
    I put your values in variable, just replace the names, as
    needed
    <cfset birthdate = "11/15/45">
    <cfset ssn = "41646562121216654">
    <cfset lastname = "Smith">
    This deletes all the / from your birthday string (if it is a
    string!) and puts it into the id variable:
    <cfset id = replace(birthdate, "/", "", "All")>
    This takes the last 4 letters/digits of your social security
    number string and adds it to the id:
    <cfset id = id & right(ssn,4)>
    This takes the first thre letters/digits from your last name
    variable, puts it in upper case and adds it to the id string
    <cfset id = id & ucase(left(lastname,3))>
    Hope it helps.

  • Why does text field in InfoPath 2010 show user name with two commas between first name and last?

    Here's the problem. I have a text field called Manager in an InfoPath 2010 form that is getting populated by a drop down field called
    Business Unit.
    The Business Unit drop-down field is pulling information from
    column A in a custom list via a managed data connection. The custom List has two columns:
    Title & Manager. 
    The Manager column in the custom list is a 'Person or Group' type column.
    The Data Connection pulls both the Title, Manager
    (and ID) data.
    There is a rule on the Business Unit drop-down field to change the value of the
    Manager text field with the Manager data on the custom list. The rule pulls the
    Manager information and filters the value to match the
    Business Unit on the Data Connection with the Business Unit drop-down
    field value (Main).
    The Business Unit drop-down field works great and pulls the value from the custom list, and the rule populates the Manager text field. The problem is that Manager text field shows the name as such:
    [smith,, john]. Notice the two commas between the last and first name. There should only be
    one comma!
    Anyone have an idea why the text field is appearing with two commas?
    Arnel

    Hi all,
    I have a workaround for this. I have an InfoPath 2010 form pulling data from a SP2010 list. The user chooses a System (Business Unit) from the dropdown list and that choice auto populates the associated user (Manager) for that system. I had to
    use concatenation, substring before and substring after to display the correct data.
    concat(substring-before(DisplayName, ",, "), ", ", substring-after(DisplayName, ",, "))
    DisplayName is the original data for the field. I am able to cut & paste this field into the formula. Therefore, I added a few spaces to separate it from the actually formula for future use.
    Select Insert Function
    Select concat
    Select the first link to double-click to insert field
    and then select Insert Function
    Select the Text category and choose substring-before
    Select the third link to double-click to insert field
    and then select Insert Function
    Select the Text category and choose substring-after
    Copy and paste your fieldname (in my case DisplayName) in the
    double-click to insert field
    parts of the substring-before and substring-after links.
    Delete the middle double-click to insert field link
    Add quotes, spaces and commas so that they match the following format:
    concat(substring-before(DisplayName, ",, "), ", ", substring-after(DisplayName,
    Translation:
    concat(substring-before(Doe,, John, ",, "), ", ", substring-after(Doe,,
    John, ",, "))
    Bring together all of the text before ",," (i.e. Doe) with ", " (comma, space) and all text after ",," (i.e. John).
    It should return
    Doe, John.
    I hope this makes sense. I have these instructions with screenshots if you need them, contact me.

  • Report error when using combo box and one text field is empty

    I'm building an interactive pdf in adobe pro 9. My problem is the following: I have one text field where you can enter a numeric code and that is used to populate another text field when I choose an option on one combo box.For example: suppose I write the code 123 in the text field "A" and that the combo box has two options ("data" and "-"). When I select "-", another text field "B" is empty, while when I select "data" i populate the text field "B" using the code entered "A" with the text "data_123". In order to do this I use the standard javascript code in the Format>Custom tab of the combo-box.
    My questions are:
    - how can I prevent the pdf to proceed selecting an option in the combo box when the field "A" is empty?
    - how can I update the field "B" every time that I change the text in "A"? I found that the text is "B" is updated only when I press the selection in the combo box.

    You can set the combo box to read-only in the Validate event of the A field:
    // Validate script for text field
    getField("combo1").readonly = !event.value;
    To update the value of B when A changes, you can expand the script above to something like:
    // Validate script for text field
    var f1 = getField("combo1");
    var f2 = getField("B");
    // If there is an entry in the A field...
    if (event.value) {
        f1.readonly = false;  // Make sure the combo box is activated
        f2.value = f1.value === "-" ? "" : "fa.value + event.value;  // Update the value of field B
    } else {
        f1.readonly = true;  // Deactivate the combo box
        f2.value = f2.defaultValue;  // Reset field B
    You might also want to reset the combo box somewhere in there, but it's not clear to me when you would want to do that.

  • Bold and italic fonts in dynamic text fields.

    I have a dynamic text field with the text "IMAGES". The font
    is Arial, it has BOLD and ITALIC checked, and has basic Latin fonts
    embedded. Now, I use Actionscript to change the text:
    textField.text = "IMAGES";
    Suddenly the text disappears! Now, it seems to me that since
    BOLD and ITALIC are checked on the text field, changing the .text
    value should simply change the text itself, which should then be
    rendered in bold and italic, and since I have bold+italic Latin
    glyphs embedded, it should display properly. But what's clearly
    happening is that when I set the text using Actionscript, it is
    attempting to display the NORMAL font instead, and since it's not
    embedded, it won't display. I know this because if I create another
    proxy text field off the screen and embed the NORMAL Arial glyphs,
    the original text field's text will display just fine - as
    normal-weight text.
    But why is this? Do I have to use a TextFormat object to set
    the text to Bold and Italic EVERY time I want to dynamicaly change
    the text? This seems silly. I simply want my text field to be bold
    and italic every time the text changes, and NO normal text!
    Any ideas?

    I met the same problem using ActionScript3 and Flash Professional CS5. There are two problems with dynamic TextFields:
    - When you set style "Bold" for a text field in CS5, the "bold" property is not available in the TextField object in ActionScript, its defaultTextFormat.bold is alway false; I don't know if we can get this property anywhere else.
    - When you change the text of the dynamic TextField object, its style changes to normal no matter whether it was bold previously.
    This is really a bug in TextField, Adobe should fix this to implement TextField in an expected way.

Maybe you are looking for

  • How to display a frame at the upper left corner of each screen?

    hi, below are 2 ways to display a frame at the upper left corner of each screen (i have 2 monitors). both work but the 2nd way is much slower. which, if any, of the 2 approaches is "more" correct? import java.awt.Canvas; import java.awt.Color; import

  • Outstanding performance: OfficeJet Pro 8500

    I have a HP OfficeJet Pro 8500 A909g Series printer, and just wanted to remark on once again having a pleasant surprise with its function.  I had a multi-page paper-based survey that I had earlier printed in duplex mode on my 8500.  Tonight, the memb

  • Jdbc thin driver to connect oracle as internal

    I need to connect to Oracle as Internal using jdbc driver, is there a way we can do this using jdbc thin driver. Actually I don't want to pass username and password as it will be harcoded in a properties file. Please let me know.

  • G4 w/ 10.4.11 Won'T Install

    I've not tried a shift bar system opening but I've tried just about everything else that has been recommended by this list, including Disk Utility. I am curious if Mac support has an established way of handling my problem. It seems so far the list ha

  • Adding cue points to NetStream

    Hello I have been working on a project and have loaded videos using netstream.  I have several cue points that advance the timeline to a certain keyframe.  Would anyone have the script for NetStream that would do this, for example, when the video rea