Merge two rows & show in a single row in table results

Hi, I need to merge 2 rows having 3 columns in a single row in table view
The cols are currently shown as :
Project NO-------(Current_Month) Revenue----------(Prior_Month) Revenue
123123 10000
20000
Revenue is a single column with revenue for diffreent Period.
10000 is for May
20000 is for April
Project NO for both are same, just the periods are different. if I am not displaying Period i need to merge the 2 rows & show as
Project NO-------(Current_Month) Revenue----------(Prior_Month) Revenue
123123 10000 20000
Please let me know how we can acheive this??
thanx
Pankaj

123123 is the project number..
the above is not getting displayed properly....as the blank spaces are removed...
Please consider this

Similar Messages

  • Merging multiple rows in to a single row (when rows meet merging criteria)

    Hi 
    I have a scenario to merge multiple rows in to a single rows when the data in those rows fall in merge criteria .Below is how my data is 
    Now the merging logic for the above rows is , we need to combine multiple rows in to a single row when the data in those rows permits us to do in that way. Simply saying , its like sandwich where we combine multiple things to a single piece.The output for
    the above rows should be
    Here  we combined Row 1 ,2, 3 in to a single row as the data in those rows permits to merge in to single row. But the row 4 cannot be combined to any of those rows because the data in those rows doesn't permits us do a merge ( As the value of the column
    JobSource for the row 4 is different from the other rows ) .
    My original data has 56 columns , but for readability i kept only 9 columns. 
    can you please throw some idea on how to achieve this scenario. I know we need to use CTE for achieving this, but i am not able succeed in doing an iteration on multiple rows.
    Appreciate your response .

    Thanks for your reply .
    Rule for merging is simple . First of all there is no unique row identifier for each row , the fact table is not having an identity column in the database . I called row 1 , row 2  etc in my post above only to make better explanation of my scenario.
    The rule for merge is below. 
    1) we can combine only when the data in a column for one row is null & the data in same column for the other row is not null . It should also satisfy the condition where the data in other columns should conflict each other.
    2) Data for all columns for the merging rows should not be conflicting (i.e. we should not merge the rows when the data in a column is not equal to the same column in the other row
    ,considering not null value)
    Steps in merging the above source data :
    1) Consider the case of row 1 and row 2 in the source, we can combine these rows as the data is satisfying the rule 1 for columns (Jobsource,Flight, Package,Update,Iscancelled
    ,Result, Severity) and columns (JobID and RuleName ) fall under rule 2.  we merge these two rows in to a single row and keep in that in the table.
    2) Then the resulting row is again merged with the second row which is present above by applying the rule 1 and rule 2 . Below would be output of merge operation.
    Now there would be only two rows in the output . But these rows cannot be merged as the data doesn't satisfy the merge rules 2 . As Jobsource for the row 1 in the above output is "PresubmissionSource" which is not equal
    to "PostSubmission" jobSource which is in row 2. So these two rows are left unmerged .So the above two rows would be the output of merge operation on my source data.
    This process has to be repeated for all the rows in the table. As of now my table as 92 Million rows with 56 columns which need to be considered for merging rows. I replicated my scenario in 9 columns and 4 rows to understand better.

  • Two radio buttons in a single row of a table

    Hi All,
    Can we have two radio buttons in a single row of ADF TABLE.
    My requirement is that i have a list of submitted records. The user can approve or reject the records.
    All the records are displayed in the table. there will be two columns in the table(Approve , Reject) The user can approve the first record and reject the second record and so on....
    using table selectOne we can select only one row. Using radio buttons how to select the multiple records, at the same time grouping is done between the two columns(radio buttons) in the table

    Hi,
    I don't think that you can do this with radio buttons. The usecase is more for chackboxes. It would have been a usecase for radio buttons if there was a single column with 3 possible options
    - pending
    - approved
    - rejected
    Frank

  • PL/SQL muliple row insert for a single row

    I need to insert multiple rows based on a single row record. Below are the table structures and sample data
    CREATE TABLE TEST_SAMPLE (NAME VARCHAR2(20), ATTR_1 VARCHAR2(20), ATTR_2 VARCHAR2(20), ATTR_3 VARCHAR2(20),ATTR_4 VARCHAR2(20));
    CREATE TABLE TRANSACTION (NAME VARCHAR2(20), ATTR VARCHAR2(20))
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('hello','asd','fgh','ert',null);For the above record in table TEST_SAMPLE, three records have to be populated\inserted into table TRANSACTION. In PL/SQL
    stored procedure i am inserting records to TRANSACTION when ATTR_1 or ATTR_2 or ATTR_3 or ATTR_4 is not null.
    Please help me to find a better way for the above insert to table TRANSACTION?

    Thanks for helping me here. For the sample record in table TEST_SAMPLE i mentioned above three records need to be inserted in table TRANSACTION. you have this, or?
    CREATE TABLE TEST_SAMPLE (NAME VARCHAR2(20), ATTR_1 VARCHAR2(20), ATTR_2 VARCHAR2(20), ATTR_3 VARCHAR2(20),ATTR_4 VARCHAR2(20));
    CREATE TABLE TEST_TRANSACTION (NAME VARCHAR2(20), ATTR VARCHAR2(20));
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 1','asd','fgh','ert',null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 2',null,'fgh','ert',null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 3','asd',null,'ert',null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 4','asd','fgh',null,null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 5','asd',null,null,null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 6',null,null,null,null);
    commit;
    insert into TEST_TRANSACTION
    select NAME,
            ATTR_1
    from TEST_SAMPLE
    where ATTR_1 is not null
    union all
    select NAME,
            ATTR_2
    from TEST_SAMPLE
    where ATTR_2 is not null
    union all
    select NAME,
            ATTR_3
    from TEST_SAMPLE
    where ATTR_3 is not null
    union all
    select NAME,
            ATTR_4
    from TEST_SAMPLE
    where ATTR_4 is not null
    commit;
    select *
    from TEST_TRANSACTION
    order by 1;
    Table created.
    Table created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    Commit complete.
    10 rows created.
    Commit complete.
    NAME                 ATTR               
    record 1             asd                
    record 1             fgh                
    record 1             ert                
    record 2             fgh                
    record 2             ert                
    record 3             ert                
    record 3             asd                
    record 4             fgh                
    record 4             asd                
    record 5             asd                
    10 rows selected.

  • To make Three row values in a single row

    Hi,
    Below is the Table Format i have.
    Here for the first Mail_ID i have 3 mail addresses.similarly for second ID too.
    I want First three rows to be in a single row.and so on...
    Plz help in doing this.
    Thanks 
    Deepa

    Deepa,
    Check if this helps.. Does dynamic conersion of data to columns ..
    --Your Email table
    create table #temp (mailid int,to_mail varchar(100))
    insert #temp select 1,'[email protected]'
    insert #temp select 1,'[email protected]'
    insert #temp select 1,'[email protected]'
    insert #temp select 2,'[email protected]'
    insert #temp select 2,'[email protected]'
    insert #temp select 3,'[email protected]'
    --Constructing a temp table to hold data with row_numbers
    select *,row_number() over(partition by mailid order by to_mail) as rn
    into #t
    from #temp
    --declaration of variables
    declare @n int,@list varchar(max),@sql nvarchar(max)
    set @n=(select max(rn) from #t)
    --Population of list to form the dynamic query
    ;with cte
    as
    select cast(',[email1]' as varchar(max)) as ch,1 as num
    UNION ALL
    select cast(ch+',[email'+cast((num+1) as varchar(100))+']' as varchar(max)) as ch,num+1 as num
    from cte where num<@n
    select top 1 @list=stuff(ch,1,1,'')
    from cte
    order by num desc
    --Formulating the complete dynamic query
    set @sql='
    select mailid,'+@list+'
    from
    select mailid,to_mail,''email''+cast(rn as varchar) as emailnum from #t
    ) tab
    PIVOT
    max(to_mail) for emailnum in ('+@list+')
    ) pvt'
    exec sp_executesql @sql
    --clean up
    drop table #t
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • How to set the first row as selected in single selection of table

    when the page renders how do we make the first row as selected for single selection in a table.
    Thansk a lot for your help

    set the selection Attribute's value to 'Y' for the first row. Thats enough.
    eg;
    Row row=vo.first();
    row.setAttribute("SelectionAttribute", "Y");
    --Prasanna                                                                                                                                                                                                                                                                                                                                           

  • ORA-01427: single-row subquery returns more than one row 01427. 00000 -  "single-row subquery returns more than one row"

    Hi All
    I have facing the  Single row sub query Error . I tried to resolve , but my condition not working .can please any help to rewrite the query (sub query)
    SELECT DISTINCT wdlsv.serial_number
         ,wdlsv.date_shipped
         ,wdlsv.inventory_item_id
         ,wdlsv.organization_id
         ,wdlsv.lot_number
         ,(select distinct engine from xxtc_tr_pr_open_data where chassis=wdlsv.serial_number and rownum=1
           union
           select distinct replace(replace(attribute11,'*',''),' ','')
           from xxtc_chassis_scanout_details
           where serial_number=wdlsv.serial_number
           and operation_line_code ='CHASSIS')                                     "ENGINE_NO"
         ,oola.attribute1     oh_excise_no
         ,msi.attribute16     vehicle_type
         ,bbom.attribute2     model_no
         ,xxst.tariff_code    tariff_code
         ,substr(xxst.color_type,1,1) color_type
         ,(SELECT TO_CHAR(trunc(rt.transaction_date),'RRRRMMDD')
                        FROM rcv_transactions rt,
                               rcv_shipment_lines rsl,
                               rcv_shipment_headers rsh
                        WHERE rsh.shipment_header_id=rsl.shipment_header_id
                           AND rt.shipment_header_id=rsl.shipment_header_id
                           AND rsl.attribute1=wdlsv.lot_number
                           AND rt.organization_id=wdlsv.organization_id
                           AND rt.organization_id=rsh.organization_id
                           AND ROWNUM<=1
                           union
                           select distinct to_char(xxtp.indent_import_date,'RRRRMMDD')
                 from xxtc_tr_pr_open_data  xxtp
                 where xxtp.chassis = wdlsv.serial_number)                                    "CKD_IMPORT_DATE_YEAR"
         ,to_char(xxtp.indent_import_date,'RRRRMMDD') import_date
    FROM WSH_DELIVERY_LINE_STATUS_V  WDLSV
        ,oe_order_headers_all        ooha
        ,oe_order_lines_all          oola
        ,mtl_system_items_b          msi
        ,bom_bill_of_materials       bbom
        ,xxtc_sales_tax_cal          xxst
    WHERE 1=1
    AND PICK_STATUS              = 'C'    
    AND delivery_status          = 'CL'
    AND ooha.header_id           = wdlsv.source_header_id
    AND ooha.header_id           = oola.header_id
    AND oola.line_id             = wdlsv.source_line_id
    AND msi.inventory_item_id    = wdlsv.inventory_item_id
    AND msi.organization_id      = wdlsv.organization_id
    AND bbom.assembly_item_id    = wdlsv.inventory_item_id
    AND bbom.organization_id     = wdlsv.organization_id
    AND xxst.inventory_item_id   = wdlsv.inventory_item_id
    AND xxst.organization_id     = wdlsv.organization_id
    and upper(msi.attribute15) not like 'SUB%'
    AND WDLSV.SERIAL_NUMBER IS NOT NULL;
    Regards
    Sanjay 

    This forum is for questions about working with SQL*Developer.  The title is "SQL Developer (Not for general SQL/PLSQL questions)" and yours is a general SQL question.  You should get a better answer by re-posting in the SQL and PL/SQL forum in the Oracle Database section.  Please mark this tread as answered and re-post there.

  • How to merge two seperate free space into single partition/volume???

    Hey guys :)
    Please help me on merging two unallocated free spaces in my internal harddisk. I already tried searching for options in diskmanagement but nothing found to do that. The harddisk has two free spaces(1gb and 50.78gb) now, I want to merge them into single one
    and finally as a single parition/volume. Is there any other method or should use any other third party tool?
    I really wanted to attach a screenshot but sadly microsoft couldn't allow me.

    JAJ
    You need a third party tool like Easeus Partition Manager
    Wanikiya and Dyami--Team Zigzag
    Sure I'll try that. Thank you very much :)
    But it is really sad to say that it is real drawback of windows as it doesn't have its own choice in diskmanagement utility.

  • How to merge two A5 pages into a single  A4 page.

    I have three PDF documents that I want to print duplexed onto a single A4 sheet. The first two pages (front and back) are A5 which is causing a problem when printing as it will not allow me to print in booklet format without cropping the back page.
    Is there any way to combine the two A5 pages into a single A4 page within Acrobat??
    I am currently running Acrobat 6.0 Standard on Windows XP SP2

    When you have been around since AA5 and earlier, the printer used to be the trick to doing things. Since AA5 a lot of the features have been built into Acrobat and it might be possible to create the page in another way. However, the print approach should still work.

  • Merge Multiple Rows in to a single Row.

    Hi
    Tab_A
    Col_1
    Col_2
    Col_3
    I want resultant rows to merge on base of Col_1 (i.e. single ‘-‘ delimited merge row for distinct value of Col_1)
    Example
    Table_A
    Col_1     |     Col_2     |     Col_3
    A     |     1     |     23
    A     |     2     |     25
    B     |     3     |     5
    B     |     6     |     9
    C     |     7     |     8
    Required Result
    Col_1     |     Col_2     |     Col_3
    A     |     1-2     |     23-25     
    B     |     3-6     |     5-9
    C     |     7     |     8
    Wishes
    Jawad

    You can try with sys_connect_by_path, but I've found Re: Aggregate function to bring values in list form more performant.
    You can write your query like this:
    SELECT col_1
               , concat_all(concat_expr(col_2,'-')) col_2
               , concat_all(concat_expr(col_3,'-')) col_3
    FROM   yourtableMHE

  • Obiee report two rows  data present in single row

    Hi Experts,
    I have facing one problem how to reslove this problem let me know.
    In DB Table like this.
    Sno **** Value1 **** Value2
    10 ******** 100 ******* 0
    10 **** *** 0 ******* 200
    i want to out put Obiee reports like this ?????????
    sno ***** value1 **** value2
    10 ****** 100 **** 200
    How to achive this please tell me any method
    i am using obiee 10.1.3.4.1 version (i am try to create report OBIEE answers )
    Thanks
    Satya
    Edited by: satya vardhan on Jul 11, 2011 6:56 PM

    Try going it by Sno.
    If you are using Pivot Table, try changing measures from columns to rows and see. I vaguely remember doing this would address your need
    Thanks,
    Vinag

  • Merging  corresponding coloumns of multiple rows to get a single row

    hi,
    plz help me in sorting out this problem.this is my query.
    select distinct h.ccid,
    DECODE(a.prmcd,'ELEREP', sum(d.period_net_dr - d.period_net_cr)) A,
    DECODE(a.prmcd,'GENREP', sum(d.period_net_dr - d.period_net_cr)) B
    DECODE(a.prmcd,'BLDGREP', sum(d.period_net_dr - d.period_net_cr)) C,
    DECODE(a.prmcd,'MCREP', sum(d.period_net_dr - d.period_net_cr)) D,
    DECODE(a.prmcd,'SPARES', sum(d.period_net_dr - d.period_net_cr)) E
    from fics_prmtrval a,
    figl_code_combinations_mview_1 c,
    figl_balances_mview_1 d,
    fims_comstr e,
    FIMS_PCSCMSTR f,
    FIMS_CCMSTR g,
    FIMS_CODECOMBINATIONS h
    where a.prmcd in('ELEREP', 'GENREP', 'MCREP', 'BLDGREP', 'SPARES')
    and a.prmval = c.segment4
    and c.code_combination_id = d.code_combination_id
    and e.cocd = c.segment1
    and f.PCSCCD = C.SeGMENT2
    and g.CCCD = C.SEGMENT3
    and h.COID = e.coid
    and h.PCID = f.PCSCID
    and h.CCID = g.CCID
    and h.stid = 1
    and h.coid = 1
    and h.pcid = 1
    group by h.ccid,
    g.ccnm,
    a.prmcd
    the output of this is :
    CCID      A     B     C     D      E
    16     1                    
    16          2               
    17     3                    
    17          4               
    17               5          
    17                    6
    but i need the out put in the following format:
    CCID      A     B     C     D      E
    16     1     2               
    17     3     4     5     6     
    plz suggest me a possible solution for this

    Hi,
    Enclose all your decodes by MAX like this MAX( DECODE(...)) and group your result by ccid column only and remove the distinct key word( it is not needed since you will be already grouping on ccid so distinct would be kind of redundant ).
    For any furthur clarifications refer this link, it is easy to follow.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:8495196364001188355::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:124812348063
    Thanks,
    Khalid

  • ALV user interface - hide details rows - show only sub-total rows

    Is there a way using the ALV interface for a user after sub-totalling to hide all the detail rows and only show the sub-total and grand total rows?

    Sure, you can force this in the code.  Please see the sample program.
    report zrich_0004
           no standard page heading.
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: sort     type slis_t_sortinfo_alv.
    data: begin of ivbap occurs 0,
          vbeln type vbap-vbeln,
          kunnr type vbak-kunnr,
          vkorg type vbak-vkorg,
          netwr type vbap-netwr,
          end of ivbap.
    * Selection Screen
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select vbak~vbeln vbak~kunnr vbak~vkorg vbap~netpr
                  into table ivbap
                          from vbak
                             inner join vbap
                                on vbak~vbeln = vbap~vbeln
                                      up to 100 rows.
    endform.
    *  WRITE_REPORT
    form write_report.
      data: layout type slis_layout_alv.
      layout-totals_only = 'X'.
      perform build_field_catalog.
      perform build_sort.
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_sort     = sort
                is_layout   = layout
                it_fieldcat = fieldcat
           tables
                t_outtab    = ivbap.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      data: fc_tmp type slis_fieldcat_alv .
      clear fieldcat. refresh fieldcat.
      clear fc_tmp.
      fc_tmp-reptext_ddic    = 'Sales Org'.
      fc_tmp-fieldname  = 'VKORG'.
      fc_tmp-tabname   = 'IVBAP'.
      fc_tmp-outputlen  = '4'.
      append fc_tmp to fieldcat.
      clear fc_tmp.
      fc_tmp-reptext_ddic    = 'Customer'.
      fc_tmp-fieldname  = 'KUNNR'.
      fc_tmp-tabname   = 'IVBAP'.
      fc_tmp-outputlen  = '10'.
      append fc_tmp to fieldcat.
      clear fc_tmp.
      fc_tmp-reptext_ddic    = 'SD DOC'.
      fc_tmp-fieldname  = 'VBELN'.
      fc_tmp-tabname   = 'IVBAP'.
      fc_tmp-outputlen  = '10'.
      append fc_tmp to fieldcat.
      clear fc_tmp.
      fc_tmp-reptext_ddic    = 'Net'.
      fc_tmp-fieldname  = 'NETWR'.
      fc_tmp-tabname   = 'IVBAP'.
      fc_tmp-outputlen  = '15'.
      fc_tmp-do_sum  = 'X'.
      fc_tmp-datatype = 'QUAN'.
      append fc_tmp to fieldcat.
    endform.
    *       FORM build_sort                                                *
    form build_sort.
      data: tmp_sort type line of slis_t_sortinfo_alv.
      clear sort. refresh sort.
    <b>
      clear tmp_sort.
      tmp_sort-fieldname = 'VKORG'.
      tmp_sort-tabname   = 'IALV'.
      tmp_sort-up        = 'X'.
      tmp_sort-subtot    = 'X'.
      tmp_sort-group     = 'X'.
      append tmp_sort to sort.
      clear tmp_sort.
      tmp_sort-fieldname = 'KUNNR'.
      tmp_sort-tabname   = 'IALV'.
      tmp_sort-up        = 'X'.
      tmp_sort-subtot    = 'X'.
      tmp_sort-group     = 'X'.
      tmp_sort-expa      = 'X'.
      append tmp_sort to sort.
      clear tmp_sort.
      tmp_sort-fieldname = 'VBELN'.
      tmp_sort-tabname   = 'IALV'.
      tmp_sort-up        = 'X'.
      tmp_sort-subtot    = 'X'.
      tmp_sort-group     = 'X'.
      tmp_sort-expa      = 'X'.
      append tmp_sort to sort.</b>
    endform.
    Regards,
    Rich Heilman

  • Re: How to merge two video files in a single file.

    If you want to get just sequence of two files, so you can use http://java.sun.com/products/java-media/jmf/2.1.1/solutions/Concat.html I suppose.
    Or some for merging on http://java.sun.com/products/java-media/jmf/2.1.1/solutions/

    Hi watergad,
    ThX good help!
    NeuralC

  • Can I merge two slide shows?

    I have created about twelve slide shows (Duh! - I thought I had to do one show for each audio track that I wanted).
    However when I burned a VCD and viewed on my TV I realized each slide show is a scene that has to be selected and played individually. What I *thought* was going to happen was they would play one after the other automatically. Soooo now I am in the process of putting all my images and audio into one slide show with multiple audio tracks BUT if I open one of my shows and 'select all' then 'copy' then close the source slide show and open my destination slide show and 'paste' all that I get is the first image. It's going to take FOREVER.
    Help. Does anyone know a way to essentially take one slide show and paste it to the end of another? I don't just want to reinsert images from the organizer because they don't show my blank slides with text, my added effects, and the re-ordering that I did in the editor.

    Vicki,
    I am not aware of putting the shows together the way you want, but what you
    could do is perhaps make a large collection so that the images fall in the
    order that you want. You can "sew" different audio files together, just have
    a look in the FAQ for the instructions on this and then attach it as a
    single file to your slide show. Please keep in mind that the larger the show
    the more difficult it is to synchronize (if you can at all) with the sound.
    Others may have other suggestions btw.
    Cheers

Maybe you are looking for

  • CS3 JS create textFrame with label then change content at a later stage.

    Is it possible to select a textframe by label? Here is a simple script which creates 2 text boxes labeled JSLabel and JSLabel2. var myDocument = app.documents.add(); var myTextFrame = myDocument.pages.item(0).textFrames.add(); myTextFrame.geometricBo

  • Mac mini 2010 start up stuck at greay screen

    Just purchased a brand new Mac mini this past weekend. 2.4 GHz, 320 hard drive. Updated to 10.6.6, migrated files from an eMac. Everything was working fantastic. Then played a Star Trek game (Elite Force II) and the disc froze. Had to shut down. Coul

  • Material documents

    Hi All, I have created goods receipt document (101 movement type), i have 4 line items in the GR. All 4 line items have same material master and plant details, this has inturn created 3 accounting documents for the same. I am of the opinion that it s

  • Yahoo home page won't come up. white page only with the words it works on it

    when i open my yahoo window it won't come up just a blank white page comes up and the words IT WORKS are on it

  • Search index problem

    One of my clients is having a strange Oracle Text problem (oracle 8), and I would be greatful for any help. Essentially, I have built a context index on a table as follows: drop index search_partner_name; create index search_partner_name on PARTNER(N