Question instr substring in obiee

Hello

I want to use the INSTR function in OBIEE

Function of POSITION is located in the forum

INSTR, function takes four values:
INSTR (string1, string2, number, number)

For example the IP address
111.222.333.444

The goal
SUBSTR (IP_ADD, 1, INSTR (IP_ADD, '.', 1, 3)-1)
111.222.333

How should the POSITION function, I use?

Thank you
MINO

830583 wrote:
any other solution?

It's really simple

SUBSTRING('111.222.333.444' FROM 1 FOR LOCATE('.','111.222.333.444',-1)-1)

Tags: Business Intelligence

Similar Questions

  • InStr/substr logic to update the column in a table db 9i / 10g / 11g

    Hi all

    I have a table Test_table with email_address column.
    Please update the table and remove
    [email protected] and
    [email protected]
    email_address column.

    Current values of the Email_address column

    [email protected], ken. [email protected], [email protected], [email protected]
    2.Ken. [email protected], [email protected], [email protected]; [email protected]
    3 ken. [email protected], [email protected], [email protected], [email protected]

    The new value must be
    1 ken. [email protected], [email protected]
    Ken 2. [email protected], [email protected], [email protected]
    3 ken. [email protected], [email protected]


    If email_address to remove is the first email address in the column
    Then, remove the first comma too, otherwise delete the comma above and email address.

    I created a C1 cursor, but I know is not the logic to use to get the new value
    Any help will be greately appreciated.

    Declare
    Cursor c1 is select rowid, email_address
    From Test_table
    Where (at the top (email_address) like ('% [email protected]%'))
    GOLD (superior (email_address) like '% [email protected]%');
    V_new_email varchar2 (200);
    BEGIN
    FOR rec IN C1 LOOP
    -do not know how to handle V_new_email to be able to update the table with the current values.
    V_new_email: = - some function instr/substr here

    Update Test_table
    Define email_address = V_new_email
    Where rowid = rec.rowid;

    END OF LOOP
    END;

    Thank you

    You needn't PL/SQL for such a thing. A SQL should be sufficient.

    with data as
    (
      select '[email protected], [email protected], [email protected], [email protected]' col from dual union all
      select '[email protected], [email protected],[email protected]; [email protected]' from dual union all
      select '[email protected], [email protected], [email protected], [email protected]' from dual
    )
    select col, trim(replace(replace(replace(col, '[email protected],'), '[email protected]'), ', ,', ',')) rep_col
      from data;
    
    COL                                                            REP_COL
    -------------------------------------------------------------- --------------------------------------------------------------
    [email protected], [email protected], [email protected], [email protected]   [email protected], [email protected]
    [email protected], [email protected],[email protected]; [email protected] [email protected], [email protected],[email protected];
    [email protected], [email protected], [email protected], [email protected]   [email protected], [email protected], [email protected]
    
  • INSTR, SUBSTR, REGEXP

    Hi friends,

    Please help me write a a request for the following scenario:

    Input string Output string
    ASDF AAA / the required textThis is the required text
    ASDF/AAA/This is the required text /XXX/ 1234 SIDThis is the required text
    / AAA / This is the required textThis is the required text
    / BBB/asdf AAA / This is the required text /qwer 1234This is the required text
    / BBB/asdf AAA / the required textThis is the required text

    that is, in all cases, the text between /AAA/ and the next / must be extracted. If there is no / after / AAA /, we have to go up to the last character in the input string.

    Thanks in advance!

    with

    channels as

    (select "asdf AAA / the required text ' input_string of all the double union")

    Select ' asdf/AAA/This is the required text 1234' /XXX/ SID Union double all the

    Select "/ AAA / the required text ' Union double all the

    Select ' / AAA BBB/asdf / the required text /qwer 1234' Union double all the

    Select ' / AAA BBB/asdf / the required text ' double

    )

    Select input_string,regexp_substr(input_string,'.*/AAA/([^/]*).*',1,1,'i',1) output_string

    channels

    INPUT_STRING OUTPUT_STRING
    ASDF AAA / the required text This is the required text
    ASDF/AAA/This is the required text /XXX/ 1234 SID This is the required text
    / AAA / This is the required text This is the required text
    / BBB/asdf AAA / This is the required text /qwer 1234 This is the required text
    / BBB/asdf AAA / the required text This is the required text

    Select input_string,

    substr (input_string,

    + 5, InStr (input_string, '/AAA/'),

    InStr(input_string || + 5,1) - instr (input_string, '/AAA/') - 5

    ) output_string

    channels

    Concerning

    Etbin

  • question of substr

    If a table contains the following lines say us TableA with values of cola

    1st row: aaa, bbbb, XXXcccc, Delalande

    2nd row: xxx, cccc, XXXddddddd, eeee

    I want to get XXXcccc and XXXddddddd of a table (the common, starting with xxx chain and ends by /), should I use substr, regular expression?

    Thank you!!

    Hello

    user480947 wrote:

    I want the results to be XXXcccc and XXXddddddd, where it begins with XXX and ends by the / when it finds.

    But "XXXcccc" and "XXXddddddd" do not end with ' / '.  You mean you want to look for a model that ends by "/" and, if it is found, return without the ' / '?

    A regular expression is easier to code:

    REGEXP_SUBSTR (str, ' (XXX [^ /] *) /', 1, 1, NULL, 1)

    or, particularly in older versions

    RTRIM (REGEXP_SUBSTR (str, ' XXX [^ /] * /'))

    , '/'

    )

    Whatever it is, if the pattern is not found, NULL is returned.

    INSTR and SUBSTR is perhaps a little faster, but it is messier.

  • Question of collapsible article - OBIEE Win64Bit 11.1.1.6.0

    Hello

    I installed OBIEE Win64Bit 11.1.1.6.0 on my Windows 7 64-Bit machine. Then I upgraded my 10 SPR g to 11g using the upgrade wizard.

    The performance of any report of the RPD level all sections, by default come as expanded with a sign - next to him. I have to manually reduce all sections. I tried to create new sections, but the same question. I tried IE 9, IE 8, Firefox and Google Chrome 12. Still the same problem.

    All the suggestions/help will be very appreciated.

    Thank you and best regards,
    Dev

    Re: Minimize the collapsible Section by default

  • Question of substring

    Hello

    I am trying to create a column by implementing this logic substr (col_name, 1, (round (length (col_name) *. 75))) in OBIEE by creating a column
    Substring (col_name from 1 for Round ((length (col_name) * 3/4), 0)) but I get the error

    "Substring operation is not allowed on the operands to call UNKNOWN." When you use round and "the 0 operator of the substring length operand must be greater than zero" when I do not use round.

    I also tried to use left-
    Left (col_name, Round ((length (col_name) * 3/4), 0)) but I got the same error.

    Is there another way I can reproduce the form of the desired column?

    Hello

    After the round, try the int value. that is, try to change your formula to something like below:

    LEFT (col_name, cast (round (LENGTH (col_name) * (0.75), 0) as int))

    Thank you

  • Question of stupid graph OBIEE 11 g

    Hi, I have a really stupid question of the graphic on OBIEE 11g. I have the following in the criteria tab:

    Fiscal year
    Accounting period
    Business unit
    Spend the amount

    I want to do a simple line chart showing Plastica as a command prompt, the 4 exercises like colors of different lines, 12 accounting periods as the horizontal axis and the amount of expenses such as the vertical axis. Sounds simple enough, but no matter what I do, I am unable to move the "measure of labels" tile in the graphic editing page. It seems to be 'locked' in the lowest position of the "Group By" box. I don't seem to be able to move it, exclude, etc..

    The problem is the presentation is as follows: through the axis labels, instead of just saying "1" to "12", all end up by saying '1 spending amount', 'amount to spend 2', 'amount to spend 3', etc.. This puts a shit ton of excess there and it is difficult to read the axis (if you are in a few Stephen, it will add it detaches completely in the eyes of the data area of the chart, where they should be). In addition, since the "chart title" and "The Vertical axis title" already say 'Spend the amount' - it is completely useless. When I look at the properties of the graph for the 'Horizontal axis title' it just says: "Accounting period", not "measure Lable + accounting period".

    Can anyone help - it's super basic, but it's driving me crazy and the graphic is horrible.

    Thank you
    Scott

    Scott,

    Not a stupid question rather stupid bug! I guess you are using 11.1.1.5.We had previously faced the same issue a SR. It's a bug! Bug hotfix request: 12810141, this solves the problem.

    Rgds,
    DpKa

  • InStr, substr

    hi
     my input values like this...
    
      1-2
      1-12
      1-123
    
    
    required output is
      
      1-002
      1-012
      1-123
        
    by using instr and substr can any one give me query..
    Not with ReG_exp

    Try this

    with t as)
    Select 1-1 one of the double
    Union
    Select 1-12' double
    Union
    Select 1-123' of the double
    )
    Select substr (a, 1, instr(a,'-')). LPAD (substr (a, InStr(a,'-') + 1), 3, '0') from t

  • Question of OPatch with OBIEE

    Hi, I am applying the 11.1.1.6.4 recent patches, but I am running with no easy way to get more space. I know that when OPatch is used, it creates backup copies that can be used to restore. I patched this server several times (11.1.1.6.0 to 6.1 to 6.2 6.2 BP1, now at 11.1.1.6.4).

    Is there an easy way to delete all the old files (assuming that I don't roll back)? If so, where are they stored?

    Thank you!
    Scott

    Hello

    Please see note: how to avoid disk full questions because OPatch backups take large amount of disk space. [550522.1 ID]

    Also be sure to save disk space, you can remove the patch files $ORACLE_HOME/Oracle_BI1 /.

    I hope this helps.

    Thank you
    SVS.

  • two questions relating to the OBIEE 11 g Linux installer

    Hello

    1. do we need to install JDK 1.6 and above before installing OBIEE? as in below post what OBIEE uses it's own JDK.

    OBIEE 11 g on Windows 7 (64-bit)

    2 we need configure the DHCP in Linux loopback adapter as well as we do in windows? If yes how to do it in Linux?



    Please let me know the answers as soon as POSSIBLE.

    Thank you
    Jay.

    Hi Jay,.

    1. do we need to install JDK 1.6 and above before installing OBIEE?

    Not required

    2 we need configure the DHCP in Linux loopback adapter as well as we do in windows? If yes how to do it in Linux?

    On Linux x 86 operating systems, configure the host to resolve to the IP address of the loopback host names by editing the file/etc/hosts to contain the following entries:

    127.0.0.1 nomhote.nomdomaine hostname
    127.0.0.1 localhost.localdomain localhost

    After that, make sure that the host name resolves to the loopback IP address by typing the following command:

    / bin/ping nomhote.nomdomaine

    Kind regards
    DpKa

  • Question of IE9 with obiee 11g

    Hi all
    I made some customizations using narrative view of obiee11G that displays a picture on the Web using HTML5. I can view the report with the image customized using all browsers except Internet Explore. After some research, I found that I need to switch browser view IE9, IE9 compatibility mode in developer tool F12.

    Is there a default way to this mode of browser to IE9 instead of modify manually every time that connect us to BI.

    Thanks in advance,
    CGI

    Have you tried clicking on tools > browser compatibility settings and see if the site is in the window? If so, delete it so that it uses is no longer the compatibility view.

    Also check this link:

    http://StackOverflow.com/questions/3726357/why-does-IE9-switch-to-compatibility-mode-on-my-website

  • question simple substring

    In a java class.
    How can I get just the str out of the string "strXXXvalue".

    Thank you

    Published by: user5156030 on August 18, 2011 08:12

    See the following code example:

    String content = "strXXXvalue";
    * / / Find from the position of the XXX
    int position = content.indexOf ("XXX");
    * / / Get the substring at the beginning of the string to the real position of the string XXX *.
    String newContent = content.substring(0,position);
    System.out.println (newContent);

    Thank you
    Nini

  • Equivalent OBIEE TO_DATE and SUBSTR functions

    I have the formula for the next column, which works correctly:

    SUM (CASE WHEN (TimeStampDiff (SQL_TSI_month, "Registration - College". "" Effective colleges F. ((("' Program Start Date ', current_date)) / 12 < 6 THEN 1 ELSE 0 END)


    I want to replace the current_date with scope of practice. Because the scope of practice is currently not in a date format (e.g. 201213, 201314, 201415), I need to use the TO_DATE and SUBSTR functions OBIEE equivalent to convert this field into a format that can be used by the TimeStampDiff function.

    The current (outside OBIEE) SQL for the conversion of the year at a date looks like this:

    To_date (substr (Fiscal_Year, 1, 4) |) '09', "YYYYMM")


    I tried to replace current_date in the column formula above by the following, but it didn't work:

    To this day (Substring ("registration - College". "D time". " "Exercise" FROM 1 to 4) | '09', "YYYYMM")

    TO_DATETIME (LEFT ("registration - College". "D time". " ("' Exercise ', 4) | ("/ 09/01 ', ' yyyy/mm/dd')

    Good course assuming that "registration - College". "D time". " "' Exercise ' is of type varchar, otherwise you will first need to cast as varchar or LEFT won't like it (but the error will tell you what the problem is exactly).

  • A string into the text and numbers using SUBSTR and INSTR

    I have the sample data. I know it's terrible database designed for a combination of text and numbers in the same field, but I can't change the business process.

    That's what I have so far:

    set linesize 5000
    
    WITH table_data
         AS (SELECT 'R: JASON BOURNE 12341560' str FROM DUAL UNION ALL
             SELECT 'R: FATS DOMINO 23432342' str FROM DUAL UNION ALL
             SELECT 'R: MARTIN LUTHER KING 3334156' str FROM DUAL UNION ALL
             SELECT 'R: TOM CRUISE 6547123' str FROM DUAL UNION ALL
             SELECT 'R: TOMMY DE GROOT 1212124' str FROM DUAL UNION ALL
             SELECT 'R: GRIM REAPER 1345245' str FROM DUAL UNION ALL
             SELECT 'R: DOCTOR DEATH THE FIRST SMITH 24356178' str FROM DUAL)
    SELECT str
         , TRIM(SUBSTR(str, INSTR(str, ' ', 1, 1), INSTR (str, ' ', 1, 2) - INSTR (str, ' ', 1, 1))) first_name
         , REPLACE(SUBSTR(str, INSTR (str, ' ', 1, 2)+1, 999), SUBSTR(str,LENGTH(str)-6,7), '') last_name
         , SUBSTR(str,LENGTH(str)-6,7) emp_num
      FROM table_data;
    
    STR                                      FIRST_NAME    LAST_NAME                 EMP_NUM
    ---------------------------------------- -----------------------------------------------
    R: JASON BOURNE 12341560                 JASON         BOURNE 1                  2341560
    R: FATS DOMINO 23432342                  FATS          DOMINO 2                  3432342
    R: MARTIN LUTHER KING 3334156            MARTIN        LUTHER KING               3334156
    R: TOM CRUISE 6547123                    TOM           CRUISE                    6547123
    R: TOMMY DE GROOT 1212124                TOMMY         DE GROOT                  1212124
    R: GRIM REAPER 1345245                   GRIM          REAPER                    1345245
    R: DOCTOR DEATH THE FIRST SMITH 24356178 DOCTOR        DEATH THE FIRST SMITH 2   4356178
    
    7 rows selected.
    

    I need to:

    1 extract the first name - which is always the first name after the 'r' - I've got that little works very well.

    2 extract the name - should be the last word before the number, if e.g. for the last night, I wish only that 'SMITH' and 'KING' for the 3rd line and "GROOT" for the 5th line.

    3. remove the number at the end, regardless of the length - some of the examples above are 8 long numbers so my attempt above does not work.

    I can't use any REGEXP or REGEXP_SUBSTR because they are not registered in the EUL I'm using discoverer, I can only use INSTR AND SUBSTR.

    I was wondering if someone might be able to help please?

    Any advice much appreciated.

    Thank you

    AW, go on them, as it's Christmas, I'm feeling generous...

    SQL > ed
    A written file afiedt.buf

    1. WITH table_data (SELECT "r: JASON BOURNE 12341560' DOUBLE UNION ALL STR ')
    2. SELECT "r: FATS DOMINO 23432342' str OF DOUBLE UNION ALL.
    3. SELECT "r: MARTIN LUTHER KING 3334156' str OF DOUBLE UNION ALL.
    4. SELECT "r: TOM CRUISE 6547123' str OF DOUBLE UNION ALL.
    5. SELECT "r: TOMMY GROOT 1212124' str OF DOUBLE UNION ALL.
    6. SELECT "r: GRIM REAPER 1345245' str OF DOUBLE UNION ALL.
    7. SELECT "r: DOCTOR DEATH FIRST SMITH 24356178' FROM DUAL str.
    8                     )
    9 select substr (str, 1, instr(str,' ')-1) as a first name
    10, substr (substr (str, 1, instr(str,' ',-1)-1), instr (substr (str, 1, instr(str,' ',-1)-1),' ', 1) + 1) as last_name
    11, substr (str, instr (str, ' ',-1) + 1) as emp_num
    12 years of (select replace (str,'R: ') as str)
    table_data 13
    14*        )
    SQL > /.

    FIRST_NAME LAST_NAME EMP_NUM
    ---------------------------------------- ---------------------------------------- ----------------------------------------
    JASON BOURNE 12341560
    FATS                                     DOMINO                                   23432342
    MARTIN                                   KING                                     3334156
    TOM                                      CRUISE                                   6547123
    TOMMY                                    GROOT                                    1212124
    GRIM                                     REAPER                                   1345245
    DOCTOR SMITH 24356178

    7 selected lines.

  • substr and instr - get all the characters after the last.

    I have a few fields tbl as follows

    ABC, 123, xyz, 234

    123, ggg, ppp, rrr

    SSS/bbb/444/a

    BB/11

    XX/bb/f

    I want to choose any characters after the last.

    so the above might give

    234

    RRR

    one

    11

    f

    played with substr and instr but have not been able to figure it out yet. He should get one after last chain / no matter where / is or how they are.

    Here is an example

    Select

    substr ("123/dd/gg ', instr (substr (" 123/dd/gg ', instr ("123/dd/gg ', ' /'") + 1 "), ' / ') + 3")

    of the double

    substr ("123/dd/gg ', instr('123/dd/gg','/',-1,1) + 1")

Maybe you are looking for

  • Issues of Java in the Sierra

    I recently installed OS Sierra and get the pop-up message, "to use the"Java"command line tool, you must install a JDK".  I installed the program several times via the link provided and rebooted my computer to restart.  The message continues to be dis

  • Satellite A500 - USB devices not detected

    I have a Toshiba Satellite A500 with a port USB 4 (Intel (r) 5 Series 4 Port SATA AHCI Controller. When I plug a usb key or a HDD on it, nothing happens. I checked the USB port driver. It is ok. Can someone help me solve this problem? Windows 7, 64 b

  • Monitor turns on every morning at 6, how to stop this?

    My monitor on my desktop goes on every morning at 06:00 how can I turn this off, because it is an unwanted wake-up!

  • HP Deskjet F4100

    I had Windows XP initially that I upgraded to 7 nowBut now when I tried to install my printer HP Deskjet F4100 of the CD, he said that it was not compatible with 7Help, pleaseI had already tried to install the drivers and all.

  • D: drive does not work. Sometimes it is read, other times not.

    I need assistance with drive D:, my computer restarts everything automatically, when restarting, "pouf" no D:. The thing is sometimes its there and sometimes it isn't. It also does not appear in disk management. The only thing I can think of is maybe