Breaking up sections of a column into multiple colums in a query

Hi,
I have a column called LEDGERACCOUNT that contains values such as '70410-TMB-MAT-MSP----'. I'd like to write a query that breaks the values between the '-' into separate columns. So far I have managed to get the first part with
left(LEDGERACCOUNT, 5)
How do I new get the others done so that, for the account above, TMB appears in one column, MAT in another and MSP in another.
For all records the values will be in the same position.
Cheers
Paul

How many times your "-" delimiter would be present? 
If its 3 times of maximum , then you can use the below:
Create Table Product(Col1 varchar(10),Col2 Varchar(1000))
iNSERT INTO Product(Col1,Col2) sELECT 1,'70410-TMB-MAT-MSP'
;With cte as (Select Col1, REPLACE(Col2,'-','.') Col2 From Product)
Select Col1, PARSENAME(Col2,4) ,PARSENAME(Col2,3),PARSENAME(Col2,2),PARSENAME(Col2,1)
From cte
Drop table Product
If the delimiter is more than 3 times, you can use the below:
Create Table Product(Col1 varchar(10),Col2 Varchar(1000))
iNSERT INTO Product(Col1,Col2) sELECT 1,'70410-TMB-MAT-MSP'
iNSERT INTO Product(Col1,Col2) sELECT 2,'70410-TMB-MAT-MSP-asdsad'
;WITH
L0 AS(SELECT 1 AS c UNION ALL SELECT 1),
L1 AS(SELECT 1 AS c FROM L0 AS A, L0 AS B),
L2 AS(SELECT 1 AS c FROM L1 AS A, L1 AS B),
L3 AS(SELECT 1 AS c FROM L2 AS A, L2 AS B),
Numbers AS(SELECT ROW_NUMBER() OVER(ORDER BY c) AS n FROM L3)
SELECT Col1, [1] AS Column1, [2] AS Column2, [3] AS Column3, [4] AS Column4, [5] AS Column5
FROM
(SELECT Col1,
ROW_NUMBER() OVER (PARTITION BY Col1 ORDER BY nums.n) AS PositionInList,
LTRIM(RTRIM(SUBSTRING(valueTable.Col2, nums.n,
charindex(N'-', valueTable.Col2 + N'-', nums.n) - nums.n))) AS [Value]
FROM Numbers AS nums INNER JOIN Product AS valueTable ON nums.n <= CONVERT(int, LEN(valueTable.Col2))
AND SUBSTRING(N'-' + valueTable.Col2, n, 1) = N'-') AS SourceTable
PIVOT
MAX([VALUE]) FOR PositionInList IN ([1], [2], [3], [4], [5])
) AS Table2
Drop table Product
Ref: https://gallery.technet.microsoft.com/T-SQL-Script-Splitting-a-33ae721c

Similar Messages

  • How can I separate one column into multiple column?

    How can I separate one column into multiple column?
    This is what I have:
    BUYER_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE
    0001 PHONE_NUMBER 555-555-0001
    0001 EMAIL [email protected]
    0001 CURRENCY USD
    0002 PHONE_NUMBER 555-555-0002
    0002 EMAIL [email protected]
    0002 CURRENCY USD
    0003 PHONE_NUMBER 555-555-0003
    0003 EMAIL [email protected]
    0003 CURRENCY CAD
    This is what I would like to have:
    BUYER_ID PHONE_NUMBER EMAIL CURRENCY
    0001 555-555-0001 [email protected] USD
    0002 555-555-0002 [email protected] USD
    0003 555-555-0003 [email protected] CAD
    Any help would be greatly appreciated.

    This is another solution. Suppose your actual table's name is test(which has the redundant data). create a table like this:
    CREATE TABLE test2 (BUYER_ID number(10),PHONE_NUMBER varchar2(50),EMAIL varchar2(50),CURRENCY varchar2(50));
    then you will type this procedure:
    declare
    phone_number_v varchar2(50);
    EMAIL_v varchar2(50);
    CURRENCY_v varchar2(50);
    cursor my_test is select * from test;
    begin
    for my_test_curs in my_test loop
    select ATTRIBUTE_VALUE INTO phone_number_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='PHONE_NUMBER';
    select ATTRIBUTE_VALUE INTO EMAIL_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='EMAIL';
    select ATTRIBUTE_VALUE INTO CURRENCY_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='CURRENCY';
    INSERT INTO test2
    VALUES (my_test_curs.person_id,phone_number_v,EMAIL_v,CURRENCY_v);
    END LOOP;
    END;
    Then you will create your final table like this:
    create table final_table as select * from test2 where 1=2;
    After that write this code:
    INSERT ALL
    into final_table
    SELECT DISTINCT(BUYER_ID),PHONE_NUMBER,EMAIL,CURRENCY
    FROM TEST2;
    If you have a huge amount of data in your original table this solution may take a long time to do what you need.

  • Split column into multiple text and number columns

    I'm trying to figure out how to split this column into multiple columns with power query. One column for the company name/person name, one for the address, one for the zip.  Some of the addresses have a three or four digit code before the address, which
    I would like in its own column too.  It's the 170 on the lastname, firstname line.  Does anyone have any pointers on this? I'm familiar with PQ advanced editor, but struggling with this one.  
    COMPANY INC. 195 MAIN ST MYCITY ST 12345
    LASTNAME, FIRSTNAME 170 477 ANY STREET CIRCLE  MYCITY ST 12345
    Thanks for your help!

    HI Gil,
    We have column with more than one numbers separated by space or comma or semicolon.
    We need to add the row for each number by keeping all other column value same.
    Here is a original table
    Col1
    Col2
    Col3
    A
    B
    11 22,33 44; 55
    C
    D
    10    20
    and expected output should be
    Col1
    Col2
    Col3
    A
    B
    11
    A
    B
    22
    A
    B
    33
    A
    B
    44
    A
    B
    55
    C
    D
    10
    C
    D
    20
    Please let us know the best way to solve this...

  • Parsing a selected column into multiple returned values

    I have a column in a table that contains a string of variable names seperated by commas. In my Select statement is it possible to break apart the string using the commas as a delimeter and get each item returned individually?
    Here's my table:
    SQL> create table myvars
    2 (x number(1), vars varchar2(200));
    Table created.
    SQL> insert into myvars
    2 values
    3 (1, 'varA,varS,varY');
    1 row created.
    SQL> edit
    Wrote file afiedt.buf
    1 insert into myvars
    2 values
    3* (2, 'varX,varU,varB,var1')
    SQL> /
    1 row created.
    SQL> edit
    Wrote file afiedt.buf
    1 insert into myvars
    2 values
    3* (3, 'varE,varI')
    SQL> /
    1 row created.
    SQL> set linesize 250
    SQL> /
    X VARS
    1 varA,varS,varY
    2 varX,varU,varB,var1
    3 varE,varI
    So, would it be possible to somehow select the a row of text where X = 2 that ends up looking like this:
    X
    2 varX varU varB var1
    ...where the column VARS is broken into 4 smaller strings of text?

    SQL> select ename from emp where empno = 7934 ;
    ENAME
    SMITH,ALLEN
    1 row selected.
    SQL> select * from TABLE(select cast(in_list(ename) as mytableType) from emp where empno = 7934) a ;
    COLUMN_VALUE
    SMITH
    ALLEN
    2 rows selected.
    SQL>Message was edited by:
    Kamal Kishore

  • To split a column into multiple columns

    Hi,
    I have column and i want to split it into three columns as shown below given inputs and required outputs. I have written this query to get P_1, and p_2 but dont know how to get p_3.
    SELECT ADDRESS,SUBSTR(ADDRESS,1, INSTR(ADDRESS,' ')-1) P_1
         ,SUBSTR(ADDRESS, instr(address,' ',-1)+1) P_2
         FROM TT
    Input:
    ADDRESS     
    1 AVENUE OF THE AMERICAS     
    2 NORTH CAROLINE STREET EAST     
    236 TURPENTINE ROAD COOPER CREEK     
    REQUIRED OUTPUT
    P_1     P_2     P_3     
    1     AMERICAS     AVENUE OF THE
    2     EAST     NORTH CAROLINE STREET
    236     CREEK     TURPENTINE ROAD COOPER
    Thanks in advance

    If you're on 10g or 11g you can do something like this ...
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 4 21:18:07 2008
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    column p_1 format a3
    column p_2 format a10
    column p_3 format a30
    with data as
    select '1 AVENUE OF THE AMERICAS' as ADDRESS from dual union all
    select '2 NORTH CAROLINE STREET EAST' as ADDRESS from dual union all
    select '236 TURPENTINE ROAD COOPER CREEK' as ADDRESS from dual
    select
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\1' ) as p_1 ,
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\3' ) as p_2 ,
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\2' ) as p_3
    from
      data
    P_1 P_2        P_3
    1   AMERICAS   AVENUE OF THE
    2   EAST       NORTH CAROLINE STREET
    236 CREEK      TURPENTINE ROAD COOPER
    3 rows selected.
    -- or try this shorter version --
    with data as
    select '1 AVENUE OF THE AMERICAS' as ADDRESS from dual union all
    select '2 NORTH CAROLINE STREET EAST' as ADDRESS from dual union all
    select '236 TURPENTINE ROAD COOPER CREEK' as ADDRESS from dual
    select
      regexp_replace( address, '^([^ ]+).*', '\1' ) as p_1 ,
      regexp_replace( address, '.*?([^ ]+)$', '\1' ) as p_2 ,
      regexp_replace( address, '^([^ ]+) (.+?) ([^ ]+)$', '\2' ) as p_3
    from
      data
    P_1 P_2        P_3
    1   AMERICAS   AVENUE OF THE
    2   EAST       NORTH CAROLINE STREET
    236 CREEK      TURPENTINE ROAD COOPER
    3 rows selected.See SQL Snippets: SQL Features Tutorials - Regular Expressions if you're unfamiliar with regular expressions.
    If you can't / don't want to use regular expressions then you'll need to settle for a more boring approach like this one.
    with data as
    select '1 AVENUE OF THE AMERICAS' as ADDRESS from dual union all
    select '2 NORTH CAROLINE STREET EAST' as ADDRESS from dual union all
    select '236 TURPENTINE ROAD COOPER CREEK' as ADDRESS from dual
    select
      substr( address, 1, instr( address, ' ' ) - 1 ) as p_1 ,
      substr( address, instr( address, ' ', - 1 ) + 1 ) as p_2 ,
      substr
      ( address,
        instr( address, ' ', + 1 ) + 1,
        instr( address, ' ', - 1 ) - instr( address, ' ' ) - 1
      ) as p_3
    from
      data
    P_1 P_2        P_3
    1   AMERICAS   AVENUE OF THE
    2   EAST       NORTH CAROLINE STREET
    236 CREEK      TURPENTINE ROAD COOPER--
    Joe Fuda
    SQL Snippets

  • Split 1 column into multiple columns

    Hi
    How can we acheive this in Sql:
    Col 1
    abc def ghi jkl
    convert to:
    Col 1
    Col 2
    Col 3
    Col 4
    abc
    def
    ghi
    jkl
    Royal Thomas

    The best approach is to NOT split them out into individual columns... It violates the 1st normal form...
    Under first normal form, all occurrences of a record[sic] type must contain the same number of fields[sic].
    First normal form excludes variable repeating fields[sic] and groups.
    The better approach is to split them into rows, in their own table, with a foreign key reference back to the table you are pulling them away from.
    If you check my 1st post you'll see that I split the string with a function. That same a function can be used to populate the new table.
    Something along these lines...
    IF OBJECT_ID('tempdb..#BadOldDesign') IS NOT NULL
    DROP TABLE #BadOldDesign;
    CREATE TABLE #BadOldDesign (
    ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
    ListOfCodes VARCHAR(100) NOT NULL
    INSERT #BadOldDesign (ListOfCodes) VALUES
    ('abc htr tbj yfd hjk mth'),
    ('bbb hyt tbj vyk hjk htd'),
    ('vvv nud'),
    ('yyy hyn tbj bdr '),
    ('htr htf tbj yfd hjk mko'),
    ('kio bhn tbj bjd hjk'),
    ('byd loj tbj yfd hjk cds');
    SELECT * FROM #BadOldDesign bod
    IF OBJECT_ID('tempdb..#ShinyNewTable') IS NOT NULL
    DROP TABLE #ShinyNewTable;
    SELECT
    bod.ID,
    sc8.ItemNumber,
    sc8.Item
    INTO #ShinyNewTable
    FROM
    #BadOldDesign bod
    CROSS APPLY dbo.SplitCSVToTable8K(bod.ListOfCodes, ' ') sc8;
    ALTER TABLE #ShinyNewTable ALTER COLUMN id INT NOT NULL;
    GO
    ALTER TABLE #ShinyNewTable ALTER COLUMN ItemNumber INT NOT NULL;
    GO
    ALTER TABLE #ShinyNewTable ADD CONSTRAINT pk_ShinyNewTable PRIMARY KEY CLUSTERED (ID, ItemNumber);
    SELECT * FROM #ShinyNewTable snt
    The dbo.SplitCSVToTable8K function that I'm using can be found here... http://www.sqlservercentral.com/articles/Tally+Table/72993/
    HTH,
    Jason
    Jason Long

  • Spliting the column Into multiple column diff secenario?

    I have one table say tab_det having two columns
    Tab_det
    Tab_tablename varchar2(50),
    Tab_tablename varchar2(50)
    Select * from tab_det;
    Tab_tablename     ---->          Tab_tablename
    ------------------ ------> ---------------------
    Emp          ------->          empno,empname,dept
    Emp_acct          ------>          empno,accno,accname,age
    I want to split the each column name from <Tab_tablename > because it contains all the
    Column name with comma separated and as a single value
    I want to split the column name for each < Tab_tablename> Corresponding to
    < Tab_tablename>
    And I want to pass the column names dynamically and the output need to be written into the File
    The Required Output In File
    Empno          empname          dept
    1          aaa               cs
    2          bbb               ec
    3          ccc               ec
    Empno          accno     accname     age
    1          12     aaa          34
    2          13 bbb          36
    3          14     ccc          38
    4          14     ddd          40

    Then do so.
    Use INSTR to identify the locations of the commas and SUBSTR to separate the pieces.
    We are not here to do your school work for you.

  • Split single column into multiple column using sql /plsql

    create table test (name varchar2(255);
    insert into test values('DH  RED 20 12/10 10 2 ');
    insert into test values('PM  STUD 20 15/10 20 29.55' );
    insert into test values('LS  MENTHOl FILTER ASC 18/70 60 240.66');
    insert into test values('WINSTON WHITE CLASSIC 13    18/70 60 240.66');
    My Output should be like as below in other table :
    create table test_result (brand varchar2(255),packet   varchar2(50),amount varchar2(25),total varchar2(25));
    BRAND                                   PACKET       AMOUNT           TOTAL
    DH  RED 20                            12/10            10              2
    PM  STUD 20                           15/10            20              29.55
    LS  MENTHOl FILTER ASC               18/70            60              240.66
    WINSTON WHITE CLASSIC 13             18/70            60              240.66can you please help me to solve this issue
    thanks in advance
    Edited by: A on Apr 21, 2012 11:33 PM
    Edited by: A on Apr 21, 2012 11:34 PM
    Edited by: A on Apr 21, 2012 11:34 PM

    h4. # Database should be 10g. If version is below 10g query need to be modified as per string format.
    h4. # Split string into two parts by '/'. First part contain brand + packet(1), Second part contain packet(2) + amount + total
    h4. # Your brand name can be of any length.
    String Format* : <Brand Name><space><packet(1)>/<packet(2)><space><amount><space><total>
    SELECT name,
           REGEXP_SUBSTR(first_part,'.+[[:space:]]',1,1) brand,
           REGEXP_SUBSTR(first_part,'[^[:space:]]+/',1,1) || REGEXP_SUBSTR(second_part,'[^[:space:]]+[[:space:]]',1,1) packet,
           REGEXP_SUBSTR(second_part,'[^[:space:]]+[[:space:]]',1,2) amount,
           REGEXP_SUBSTR(second_part,'[^[:space:]]+$',1) total
    FROM
      (SELECT trim(name) name,
              trim(substr(name,1, instr(name,'/'))) first_part,
              trim(substr(name,instr(name,'/')+1)) second_part
       FROM test )
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Convert 2 columns into multiple column table

    Hi,
    I have table with two columns. See below. I need to create a kind of matrix presentation of the table, so that values in row B become column titles, see second table. Amount of data is too big to create this manually.
    TC1
    Req2
    TC2
    Req1
    TC3
    Req0
    TC4
    Req1
    TC5
    Req2
    TC6
    Req3
    TC7
    Req4
    TC8
    Req5
    TC9
    Req6
    TC10
    Req7
    TC11
    Req8
    TC12
    Req9
    TC13
    Req10
    TC14
    Req11
    TC15
    Req12
    TC16
    Req7
    TC17
    Req8
    TC18
    Req3
    TC19
    Req13
    TC20
    Req14
    TC21
    Req15
    TC22
    Req16
    Req1
    Req2
    Req3
    Req4
    Req5
    Req6
    Req7
    Req8
    TC1
    X
    TC2
    X
    TC3
    X
    TC4
    X
    TC5
    TC6
    X
    X
    TC7
    X
    TC8
    TC9
    X
    X
    TC10
    TC11
    X
    TC12
    X
    TC13
    X
    X
    TC14
    X
    X
    TC15
    X
    TC16
    TC17
    X
    TC18
    X
    TC19
    TC20
    X
    X
    x
    TC21
    X
    TC22
    X
    Any suggestions how to proceed are greatly appreciated!
    Question: Would Excel's PivotTable do the trick? No scripting needed?

    Hi and thanks for your reply! I added leading zeros. I tried the formula and the result looks like this from my first sample:
    Req01
    Req02
    Req03
    Req04
    Req05
    Req06
    Req07
    Req08
    Req09
    Req10
    Req11
    Req12
    Req13
    Req14
    Req15
    Req16
    TC1
    x
    TC2
    x
    TC3
    TC4
    TC5
    TC6
    x
    TC7
    x
    TC8
    x
    TC9
    x
    TC10
    x
    TC11
    x
    TC12
    x
    TC13
    x
    TC14
    x
    TC15
    x
    TC16
    TC17
    TC18
    TC19
    x
    TC20
    x
    TC21
    x
    TC22
    x
    So row value remain empty if column value has earlier been met. Eg. TC17. Any ideas?

  • Regarding ssis - split multi value column into multiple records

    Hi,
    I have one scenario
    Table
    Col1. Col2
    1. A,b,c,df,ghf
    2. C,b
    3. B
    Output should be
    Col1. Col2
    1. A
    1. B
    1. C
    1. Df
    1. Ghf
    2. C
    2. B
    3. B
    please help

    Try the below:
    Create TVF as below:
    CREATE FUNCTION [dbo].[split]
    ( @String NVARCHAR(4000), @Delimiter NCHAR(1) )
    RETURNS TABLE
    AS
    RETURN
    With Split(stpos, endpos)
    AS (
    SELECT 0 AS stpos, CHARINDEX(@Delimiter, @String) AS endpos
    UNION ALL
    SELECT endpos + 1, CHARINDEX(@Delimiter, @String, endpos + 1)
    FROM Split
    WHERE endpos > 0
    SELECT 'Id' = ROW_NUMBER() OVER (ORDER BY (SELECT 1)),
    'Data' = SUBSTRING(@String, stpos, COALESCE(NULLIF(endpos,0), LEN(@String)+1)-stpos)
    FROM Split
    Test script:
    create Table Test_Table(id int, data varchar(4000))
    Insert into Test_Table Values(1,'a,F,c, G'),(2,'LASD,wer,yy')
    Select A.id,upper(Left(b.Data,1)) + lower(Right(b.data, Len(b.data) - 1)) From Test_Table A
    Cross Apply dbo.split(A.data,',') B
    Drop table Test_Table

  • How can I Make one column into Multiple columns

    Id
    SCM-01-015
    SCM-01-020
    SFA-02-021
    SFC-02-042
    STB-03-035
    STP-04-167
    SVF-06-150
    I want the output like this
    Id 01 02 03 04 06
    SCM-01-015 5
    SCM-01-020 10
    SFA-02-021 15
    SFC-02-042 15
    STB-03-035 20
    STP-04-167 50
    SVF-06-150 5
    thank you in advance

    Hi,
    801668 wrote:
    Id
    SCM-01-015
    SCM-01-020
    SFA-02-021
    SFC-02-042
    STB-03-035
    STP-04-167
    SVF-06-150
    I want the output like this
    Id 01 02 03 04 06
    SCM-01-015 5
    SCM-01-020 10
    SFA-02-021 15
    SFC-02-042 15
    STB-03-035 20
    STP-04-167 50
    SVF-06-150 5
    thank you in advanceWhenever you post formatted text (such as query output) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after formatted text, to preserve spacing.
    Do you want output something like this, which is from the scott.emp table?ENAME ANALYST CLERK MANAGER PRESIDENT SALESMAN
    ALLEN 1600
    JONES 2975
    FORD 3000
    CLARK 2450
    MILLER 1300
    SMITH 800
    WARD 1250
    MARTIN 1250
    SCOTT 3000
    TURNER 1500
    ADAMS 1100
    BLAKE 2850
    KING 5000
    JAMES 950
    (ALLEN is a SALESMAN, JONES is a MANAGER, ..., JAMES is a CLERK.)
    If so, do a pivot, somehting like this:SELECT     ename
    ,     MIN (CASE WHEN job = 'ANALYST' THEN sal END)     AS analyst
    ,     MIN (CASE WHEN job = 'CLERK' THEN sal END)     AS clerk
    ,     MIN (CASE WHEN job = 'MANAGER' THEN sal END)     AS manager
    ,     MIN (CASE WHEN job = 'PRESIDENT' THEN sal END)     AS president
    ,     MIN (CASE WHEN job = 'SALESMAN' THEN sal END)     AS salesman
    FROM     scott.emp
    GROUP BY ename
    Always say which version of Oracle you're using.
    The query above will work in Oracle 8.1 or higher, but starting in Oracle 11 there's a better way:  SELECT ... PIVOT.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Breaking up an existing BA into multiple BA's

    We have 1 large business area we would like to break up into multiple business areas. So far this has proven to be quite a challenge. We can create a new business area and import the existing business area, then delete all the elements we dont need, however, several issues arise from this. First, every folder and item gets a 1 placed after it, which is annoying, but livable. The second thing is workbooks, how do you associate a report created in the existing business area to the new business area. One good thing is it retains all the joins. Another approach we tried was just copy/paste folders from existing to new business area, but again you get the 1's and 2's after items, also, it doesnt retain the joins.
    Anyone know how to break up a Business area cleanly? I certainely dont want to rebuild everything from the ground up again.
    Thanks,
    CC

    The following steps should help you to break up a alrge business areas into multiple ones.
    Export the business area or the full EUL as a backup copy.
    Export folders, individual or multiple depending on the joins.
    Delete the existing business area.
    Create the new business areas.
    Import Folders into the new business areas by selecting the option of 'Rename the existing object' to avoid 1s and 2s (although there are no objects, EUL may still remember them internally).
    You won't be able to associate the existing workbooks to the new business areas automatically. I hope you don't have many workbooks as you may have to recreate them!

  • Easy Question: How to split concatenated string into multiple rows?

    Hi folks,
    this might be an easy question.
    How can I split a concatenated string into multiple rows using SQL query?
    INPUT:
    select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
    Expected output:
    data
    AAA
    BBB
    CCC
    DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
    Thanks,
    Tomas

    Here is the SUBSTR/INSTR version of the solution:
    SQL> WITH test_data AS
      2  (
      3          SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
      4  )
      5  SELECT  SUBSTR
      6          (
      7                  DATA
      8          ,       INSTR
      9                  (
    10                          DATA
    11                  ,       ','
    12                  ,       1
    13                  ,       LEVEL
    14                  ) + 1
    15          ,       INSTR
    16                  (
    17                          DATA
    18                  ,       ','
    19                  ,       1
    20                  ,       LEVEL + 1
    21                  ) -
    22                  INSTR
    23                  (
    24                          DATA
    25                  ,       ','
    26                  ,       1
    27                  ,       LEVEL
    28                  ) - 1
    29          )       AS NEW_STRING
    30  FROM    test_data
    31  CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
    32  /
    NEW_STRING
    AAA
    BBB
    CC
    DDDD

  • Splitting comma seperated column data into multiple rows

    Hi Gurus,
    Please help me for solving below scenario. I have multiple value in single column with comma seperated values and my requirement is load that data into multiple rows.
    Below is the example:
    Source Data:
    Product         Size                                 Stock
    ABC              X,XL,XXL,M,L,S                 1,2,3,4,5,6
    Target Data:
    Product         Size                                 Stock
    ABC              X                                     1
    ABC              XL                                   2
    ABC              XXL                                 3
    ABC              M                                    4
    ABC              L                                      5
    ABC             S                                        6
    Which transformation we need to use for getting this output?
    Thanks in advance !

    Hello,
    Do you need to do this tranformation through OWB mapping only? And can you please tell what type of source you are using? Is it a flat file or a table?
    Thanks

  • Displaying data from multiple columns into a single line graph

    Post Author: hollowmatrix
    CA Forum: WebIntelligence Reporting
    Hey,I have an issue with the WEBI reporting.I have a data source that has multiple columns say ( month1, month2, month3, month4,.....month 12, month 13, ....month24) with the sales data for each month.Now say I call the month 1 to month 12 as "current year", and call month 13 - month 24 as "previous year".I want to put a prompt in the report which allows  me to select between "current year" and "previous year".Based on the prompt value we get a graph of the sales vs month ....as in if we select  "current year", then we get a graph of the sales Vs time( remember that the sales data for each month is in a different column.)and if we select  "previous year" then we get a graph of the sales Vs time for previous year..( sales vs time for Month 13, month 14, month 15....month 24).I am not able to pull data from multiple columns into a single object that I can use to populate the graphs.Any help on the same will be appreciated .   

    Hi,
    <p>
    please click
    here (asktom) and look for the words "how about the other way round"
    </p>

Maybe you are looking for

  • How do I kill my daugter's iphone so I can switch the responsible itunes account?

    I made the mistake when setting up my daughter's iPhone4 (verizon) of setting it up in my wife's iTunes account.  I've now created correct account, but even when I restore phone, it still reverts to my wife's iTunes account.  I've read the support fo

  • Integrate adobe reader on iPad with iPhone

    Can I integrate adobe reader on my iPad with my iPhone?

  • Inserting or Importing

    Hi Folks, Can anybody tell me if I can insert an SWF flash file into another Flash file. Using Flash ver 8 Thanks Sage

  • Unable to log into NOKIA Messaging

    Hi, I changed my Windows Live password and now I'm unable to log into the nokia messaging site. This WL id was used to create the Nokia EMail account. How to reset the password in Nokia EMail.

  • Jdbc slow on sybase on solaris

    Hi there, I have a very simple query which selects all the rows from a very large table (50,000,000 rows). When I execute this query using ISQL on a remote client, the results come back relatively quickly (~5 seconds for 100,000 rows). When I execute