Analysis report with totals on specific columns

I have an analysis report that I need to create totals on specific columns. If I turn on "Grand Totals" from the "Edit View: Table" section, all of the numeric columns will display grand totals. This is a nice automatic feature, but I only need totals of specific columns. Not all numeric columns need totals nor do Grand Totals of some columns make any sense.
For example, to display opportunity details, we will have on the report:
Opportunity Name, Item number, Item Description, Quantity, Price, Extended Price
Since the opportunity may have multiple items on it, having a grand total of quantity and unit price makes no sense. All we need is Grand Total of the opportunity extended price.
Is there a way to selectively turn on/off column totals or is it an all or nothing option?
Thanks in advance.
Edited by: nsidev on Sep 1, 2009 10:10 AM

Actually, i just solved the problem.
Here is what I did:
1. I added a column to the "Design Criteria" section (step 1). To keep the units consistant, I made sure that the data element was suitable for the value (I used a currency element). Ensure you note the position of the new column, mine was in position 11.
2. Under the newly added elements "Column Properties", I set it to HIDDEN and changed the name to "Grand Total"
3. Under the "Edit Formula", I changed the formula to be: SUM(<numeric column>)
4. In "Create Layout" (Step 2), I added a narrative view to the bottom of the page.
5. In the "Edit Narrative View", I set the appropriate formatting and added the following: Total Extended Price: @11
6. Ensure that "Rows to display" is set to 1.
Save and run
All done, works like a charm.

Similar Messages

  • How to create a report with dynamic no of columns

    Hi All,
    we have a report with 6 columns.
    and its been access by 10-20 people.
    the user dont want to have a fix report with 6 columns rather they want to have a flexibility to select the columns from the report they want to see.
    i.e. user one one time wasnt to see only one columns
    another time he want to see only column 2 and 4 of the report.
    its like there can be a multiple select option from where he can select the columns in the existing report and then see the same report with only that much column.
    Please tell me how to implement it.

    Abhip i thin you didnt get the problem.
    there is s exeiting report with 6 column
    Currently when i logging to OBIEE and see that report
    i will be getting report with 6 column
    but now i want a flexibility of selecting only 2 or 3 or 1 or 4 or 5 as i wish columns from this report and see the result only for that
    so is there by any chance i can have a check box for each column which i can check in dashborad to select that column
    and show the result were as by default it will show the report with 6 column.
    Thanks

  • Form report with both edit and column link

    hi experts,
    How can we create form report with both edit and column link. Ie, the form should have both the Edit link and column link. When we click on the edit link(in page1) it should go for the page2 and the page2 should display the corresponding row fields which should be editable. but when i click the column link it should bring me to the next page but the corresponding values of the column should not be editable.
    Regars,
    KK

    hi,
    Here i have achieved this by making the column link and page navigation.

  • Report with more than 30 columns

    XML Pub Gurus,
    I have a requirement where I need to create a table layout with proper spacing for more than 30 columns and I asked this question in Open World XML Pub team and they responded to my question as "The page size in word has to be increased to allow to add those many columns". I was satisfied with the answer without knowing that Word will not allow more than 22" long in landscape. So, I am puzzled with the answer in Open World.
    So, could somebody please give me guide lines to create this type of report for more than 30 Columns. This is very common requirement for us to report some of the stuff from the db.
    Thanks in advance
    Ram G

    What do you want your final destination format to be? I'm thinking you'll probably want to go out to HTML or Excel. I would think that would be the only place where you could read and use a report with more than 30 columns.
    Here's an idea if you want to go to excel and if you are using the 10.1.3.2 Enterprise (standalone) version.
    1. Create your query with as many columns as you want.
    2. Don't create a layout at all
    3. Launch Excel Analyzer.
    4. From within Excel, build your report based off the downloaded data (for example add a pivot table).
    5. Upload your excel Analyzer template back to the server
    This template can now be scheduled and delivered like normal templates or updated with current data directly from within Excel.

  • Reports with more than 100 columns

    I am using Apex 3.2. I am using a classic report with more than 100 columns. So to use the custom heading in the report, I exported the page,did modification in exported sql file and imported back.
    But when I am passing the parameters from a input screen for the first time either it is showing the all data avilable in the database or with only header. If I do the refresh in input screen and try it then it is working as intended. I am updating at the below loaction of the page.Let me know if I have to update anything more in the sql file.
    declare
    s varchar2(32767) := null;
    begin
    s := null;
    wwv_flow_api.create_report_columns (
    p_id=> 200100535534034253 + wwv_flow_api.g_id_offset,
    p_region_id=> 2003453533453 + wwv_flow_api.g_id_offset,
    p_flow_id=> wwv_flow.g_flow_id,
    p_query_column_id=> 157,
    p_form_element_id=> null,
    p_column_alias=> 'XYZ',
    p_column_display_sequence=> 157,
    p_column_heading=> 'XYZ 123',
    p_column_alignment=>'LEFT',
    p_disable_sort_column=>'Y',
    p_sum_column=> 'N',
    p_hidden_column=> 'N',
    p_display_as=>'WITHOUT_MODIFICATION',
    p_pk_col_source=> s,
    p_column_comment=>'');
    end;
    /

    Hi,
    Its just a general thought and I realize you know your application and user community better I do, but do you think your users are going to be very happy when they are presented with a report with more than a hundred columns? Have you considered maybe presenting the data in some sort of rolled up form from which the user can then drill down to the data they are particularly interested in. Also, I'm sure your LAN administrator would be happy not to see 100+ column by x number row reports being regularly shipped across the network.
    Also, 100+ column reports suggests tables with 100+ columns which are probably not designed in a very relationally compliant way. I find that good DB design usually results in applications that have to make less compromises, such as hacking export files in order to fool the API into making ridiculous, unsupported and unsupportable compromises.
    Just a thought..................
    Regards
    Andre

  • I want to create a report with more than  64 column's.

    I want to create a report with more than 64 column's. I have generated Query the XML.When I tried to create a template for the report.I have Inserted the colum's Wizard and finish it throughing error message. "you cannot create atable with more that 63 coloum's "

    Hi ,
    Can u Check the below thread
    More than 63 columns in rtf template

  • GL Account analysis report with ALV Grid control

    Hi Everyone,
    I am looking for a GL Account analysis report with ALV Grid Control.
    Can I get sample code for this report.
    Thank you
    Prasad

    Hi Rob,
    Actually, I am searching for a Report which gives GL account analysis.
    If anybody can throw more light on this ...it would be great.
    Which Tables and fields i should refer for this report.
    Thanks

  • Accounts rceievable analysis report with VAT inclusion

    Hi All,
    I have been asked to include the VAT amount paid by each customer in the Accounts recievable and payable analysis report.
    The problem is posting for VAT goes to General Ledger and the total amount is posted to Customer.
    The report currently in BW doesnt give the split of the amount for a customer.
    We have a cube which stores all the FI-AR line items and we have a ODS which stores GL line items.
    The GL line item ODS obiviously doesnt have customer number.
    I tried creating a multiprovider on the FI-AR cube and GL ODS but didnt get the expected result.
    Can anyone please suggest on how to approach this problem.
    Points will be rewarded..
    Thanks
    Sundar

    Update:
    Within the \config\xml\migration-config_PreMigrationAnalysis.xml configuration file you can control the buffering of records. I changed the buffer size from 15000 to 10 and now any object type with count over 10 fails on the 11th object of that type.
    Next step: Check the behaviour of the other configurations.
    <!-- List of source controller properties.-->
    <properties>
         <!-- List of Connection properties to connect to the OW instance.-->
         <property name="url" value="http://qat.idm.com"/>
         <property name="username" value="idm-config"/>
         <!-- This property specifies the location of the individual OW object reports.-->
         <property name="objectReportDirLocation" value="./reports"/>
         <!-- This property specifies the maximum number of records that shall be displayed in an individual OW object report.-->
         <property name="reportRecordsLimit" value="15"/>
         <!-- This property controls the creation of a local login to OW. Allowed Values are true/false.-->
         <property name="requireLocalSession" value="false"/>
         <!-- This property controls the buffering of OW object queries. Allowed Values are true/false.-->
         <property name="bufferQuery" value="true"/>
         <!-- This property controls the buffer size of OW object queries.-->
         <property name="bufferSize" value="10"/>
    </properties>

  • Report with multiple choice in column for same dimension......

    Hi All,
    We have a report with two dimensions in col , one in row remaining in pov...user want to select multiple members [its more than 10 members..so we thought prompts will not be good.] for one column for different members in second dimension of column and want see the variance between them.
    can anyone suggest me how can i achieve this. thank you
    regards,
    Ravi

    Hi All,
    Can any one suggest me on this. thanks inadvance.
    Regards,
    Ravi

  • Sales analysis report- showing & totaling both Invoices & Credit memos on o

    I have written a Several sales analysis reports based on INV1 tables and RIN1 tables, (Invoice lines and Credit memo lines) for SAP B1 using crystal. I would like the data from both the invoices & the credit memo to list & total on the same report. But have had no luck doing this.
    Is it possible?
    How would I go about doing it?

    Solved my problem, I used the "Show SQL Query" window on my existing reports copied and pasted them to SQL Management Studio as a View, used keyword Union All to join the two queries (Invoices and Credit memos)  and used the view as the data link to create a new report in Crystal Report writer.
    This got me both of the data files into the report detail line and allow for summing.
    Problem solved.
    Thanks for the input.

  • Unable to create cross tab report with multiple level dynamic columns

    Hi Gurus,
    We are trying to develope group above cross tab report with BI Publisher.
    i am unable to achieve multiple level columns dynamically.Using cross tab wizard i can achieve single level measure column ,but not the second level column.
    Output should look like this:
    Country1
    Region1 Region2 Region3 --(level1 column)
    d1 d2 d3 d1 d2 d3 d1 d2 d3 -- (level2 column)
    Row1 10 20 30 70 80 90 40 70 90 --data
    Row2 21 24 54 65 23 64 64 76 87
    Here regions and d1 d2 d3 may vary based on xml data.Also we have page break on country.
    Thanks,
    Mahesh

    Hi kavipriya,
    Any update on this.I have set the rtf and xml to ur gmail id.
    Thanks,
    mahesh

  • Combined Analysis Report - Grand Total

    Is it possible to have a grand total on a "Combined Analysis" report?

    I think you can use the Pivot Table view and show the sum of rows. If no digits appear in the metrics, set the Aggregation Rule to Sum.

  • Cost element report with cost object name column

    Hi,
    i'm looking for a report similar to S_ALR_87013601: Cost Elements: Breakdown by Object Type, but including a column with the cost object name. Does anyone know if such a report exists? If it doesn't exist, how can i create a report like this?
    Some of my company costs are assigned to cost centers and some of them are assigned to wbs elements. We would like a report where we could have all the information together.
    Thank you very much

    Hi Xavi ,
    Some of my company costs are assigned to cost centers and some of them are assigned to wbs elements. We would like a report where we could have all the information together.=>
    There is not standard report available..  which will display total cost per company code.. i,e cost booked on cost centers, internal order and WBS elements ... This is becuse each modules store data in seperate tables.
    You have to create a ABAP report to serve your pourpose. You have to collate all the costs booked in a company code for cost centers, IO and WBS elements . Pick up real costs only as per company code..
    We are using such custom report and its working fine.
    Regards
    Sarada

  • Alv report with varying number of columns

    hi all,
    I am new to abap. I am writing this to get a brief idea of what i wanted to do in system.
    I have to do a report using alv.  The format of the report looks like this.
    acc no     acc. name     amt_sum_april   amt_sum_may   amt_sum_june. ............. total_months
    the colum amt_sum_ depends on user input period(month interval).
    if the user selects 4 to 6 = 3 columns ,if the user selects 4 to 10 = 7 columns
    so on.......
    Anyone have idea how to do it, because in the
    initial structure or itab, the number of columns depends on the user input.. i am stucking here ...
    pls help.
    thanks and regards
    jose

    Hi friend,
    It's very complicated to do that, I'm sure there's a way to do it but I really don't know it. Once I had a similar requirement and I did something else that solved my problem without making a fussy complicated code. I added a colum MONTH or PERIOD (depending on your requirement) and then I make a subtotal by that column. So you need:
    acc no acc. name amt_sum_april amt_sum_may amt_sum_june. ............. total_months
    Now you would have:
    acc no acc. name    month     amount
    In the SORT table, in the sorting condition by MONTH you specify SUBTOTAL = 'X'. So the output will be:
    acc no acc. name    month     amount
    123123        John      2            100.00
    123124        Paul      2            200.00
    Month  2                                300.00
    123123        John      3            300.00
    123124        Paul      3            400.00
    123125        Jane      3            100.00
    Month  3                                 800.00
    123123        John      4            123.54
    Month   4                                123.54
    Total                                      1223.54
    You can change the subtotal text for a more adequate one (if you want). Also if you only need the subtotals you can specify in the layout that only those lines are to be output.
    I hope I've helped, I you have any question let me know!
    Regards,
    Pablo

  • Matrix report with dynamic and fixed columns

    Hi all,
    I have a matrix report which has dynamic as well as few fixed columns.
    It is a fixed asset Report in which the sum(cost) in cell should be grouped according to column and row-wise.
    The row consists of the activity such as additions, retirements etc and the dynamic column is the category and other fixed columns such as CIP cost, CWIP cost will be grouped only according to row.
    the actual layout should be like this
                     | category 1 | category 2 | category 3 ...... | CIP cost | CWIP cost
    Additions    | Sum(cost) | Sum(cost)  | Sum(cost)  .......| 1234      | 4500
    retirements | Sum(cost) | Sum(cost)  | Sum(cost)  .......| 1000      | 2500but due to fixed colums in the layout the report builder pushes the fixed colums to the next row with single query i get
                     | category 1 | category 2 | category 3 ...... |
    Additions    | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
                      CIP cost     | CWIP cost
                       1234        | 4500
    retirements | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
                      CIP cost     | CWIP cost
                       1000        | 2500if i try to add those columns alone in a seperate query and then build the report i get the layout like this
                     | category 1 | category 2 | category 3 ...... |
    Additions    | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
    retirements | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
    CIP cost     | CWIP cost
    2234        | 7000This is my query, i have used union to get the row-wise column activity
    /* Formatted on 03-Sep-12 5:23:11 PM (QP5 v5.114.809.3010) */
      SELECT   DISTINCT /*ASSET_ID
                        SUM (cost),
                        SUM (cip_cost),
                        SUM (cip_cost_pk),
                        cat_desc--,sub_cat_desc
                        ,activity
        FROM   (-- cip cost
                SELECT   DISTINCT asset_id,
                                  cost,
                                  ytd_deprn,
                                  deprn_amount,
                                  deprn_reserve acc_deprn,
                                  cost - deprn_reserve net_bk_val,
                                  cip_cost,
                                  cip_cost_pk,
                                  description cat_desc,
                                  fat_desc sub_cat_desc,
                                  activity
                  FROM   (SELECT   DISTINCT
                                   fb.asset_id,
                                   fb.cost,
                                   facc.cost cip_cost,
                                   0 cip_cost_pk,
                                   ds.ytd_deprn,
                                   ds.deprn_reserve,
                                   fc.description,
                                   fat.description fat_desc,
                                   ds.deprn_amount,
                                   DECODE (
                                         facc.asset_type
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || di.transtype,
                                         'CIP'
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || 'TRANSFER',
                                      'CIP T/F',
                                      'CIP-0012-' || di.transtype,
                                      'Additions Project Khalifa assets',
                                      'CAPITALIZED-' || fc.segment1 || di.transtype,
                                      '0',
                                      'Additions'
                                      activity
                            FROM   fa_books fb,
                                   fa_additions_b fa,
                                   fa_methods fm,
                                   fa_financial_inquiry_cost_v fic,
                                   fa_categories_vl fc,
                                   fa_capitalize_cip_v facc,
                                   fa_additions_tl fat,
                                   fa_deprn_summary ds,
                                   fa_distribution_inquiry_v di
                           WHERE       ds.asset_id = fa.asset_id
                                   AND fb.asset_id = fa.asset_id
                                   AND fb.asset_id = fic.asset_id
                                   AND di.asset_id = fb.asset_id
                                   AND fb.life_in_months = fm.life_in_months
                                   AND fb.book_type_code = ds.book_type_code
                                   AND fb.book_type_code = fic.book_type_code
                                   AND fa.last_update_date >
                                         TO_DATE (
                                               '01'
                                            || 'JAN'
                                            || TO_CHAR (SYSDATE, 'RRRR'),
                                            'DD-MON-RRRR'
                                   AND ds.deprn_run_date =
                                         (SELECT   DISTINCT MAX (deprn_run_date)
                                            FROM   fa_deprn_summary
                                           WHERE   asset_id = fb.asset_id)
                                   AND fic.transaction_header_id_in =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id_in)
                                            FROM   fa_financial_inquiry_cost_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fb.date_effective =
                                         (SELECT   DISTINCT MAX (date_effective)
                                            FROM   fa_books
                                           WHERE   asset_id = fb.asset_id)
                                   AND di.transaction_header_id =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id)
                                            FROM   fa_distribution_inquiry_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fa.attribute_category_code =
                                         fc.segment1 || '-' || fc.segment2
                                   AND fc.segment1 <> '0012'
                                   AND fb.asset_id = facc.asset_id
                                   AND fa.asset_id = fat.asset_id
                                   --AND facc.asset_type <> 'CAPITALIZED'
                                   AND fb.deprn_method_code = fm.method_code
                                   AND ds.deprn_source_code <> 'BOOKS'
                                   AND DECODE (
                                         facc.asset_type || '-' || fc.segment1,
                                         'CIP-0012',
                                         'Additions Project Khalifa assets',
                                         'CAPITALIZED-' || fc.segment1,
                                         '0',
                                         'Additions'
                                      ) <> '0'/*ORDER BY fb.asset_id*/
                UNION
                --cip cost pk
                SELECT   DISTINCT asset_id,
                                  cost,
                                  ytd_deprn,
                                  deprn_amount,
                                  deprn_reserve acc_deprn,
                                  cost - deprn_reserve net_bk_val,
                                  cip_cost,
                                  cip_cost_pk,
                                  description cat_desc,
                                  fat_desc sub_cat_desc,
                                  activity
                  FROM   (SELECT   DISTINCT
                                   fb.asset_id,
                                   fb.cost,
                                   0 cip_cost,
                                   facc.cost cip_cost_pk,
                                   ds.ytd_deprn,
                                   ds.deprn_reserve,
                                   fc.description,
                                   fat.description fat_desc,
                                   ds.deprn_amount,
                                   DECODE (
                                         facc.asset_type
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || di.transtype,
                                         'CIP'
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || 'TRANSFER',
                                      'CIP T/F',
                                      'CIP-0012-' || di.transtype,
                                      'Additions Project Khalifa assets',
                                      'CAPITALIZED-' || fc.segment1 || di.transtype,
                                      '0',
                                      'Additions'
                                      activity
                            FROM   fa_books fb,
                                   fa_additions_b fa,
                                   fa_methods fm,
                                   fa_financial_inquiry_cost_v fic,
                                   fa_categories_vl fc,
                                   fa_capitalize_cip_v facc,
                                   fa_additions_tl fat,
                                   fa_deprn_summary ds,
                                   fa_distribution_inquiry_v di
                           WHERE       ds.asset_id = fa.asset_id
                                   AND fb.asset_id = fa.asset_id
                                   AND fb.asset_id = fic.asset_id
                                   AND di.asset_id = fb.asset_id
                                   AND fb.life_in_months = fm.life_in_months
                                   AND fb.book_type_code = ds.book_type_code
                                   AND fb.book_type_code = fic.book_type_code
                                   AND fa.last_update_date >
                                         TO_DATE (
                                               '01'
                                            || 'JAN'
                                            || TO_CHAR (SYSDATE, 'RRRR'),
                                            'DD-MON-RRRR'
                                   AND ds.deprn_run_date =
                                         (SELECT   DISTINCT MAX (deprn_run_date)
                                            FROM   fa_deprn_summary
                                           WHERE   asset_id = fb.asset_id)
                                   AND fic.transaction_header_id_in =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id_in)
                                            FROM   fa_financial_inquiry_cost_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fb.date_effective =
                                         (SELECT   DISTINCT MAX (date_effective)
                                            FROM   fa_books
                                           WHERE   asset_id = fb.asset_id)
                                   AND di.transaction_header_id =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id)
                                            FROM   fa_distribution_inquiry_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fa.attribute_category_code =
                                         fc.segment1 || '-' || fc.segment2
                                   AND fc.segment1 = '0012'
                                   AND fb.asset_id = facc.asset_id
                                   AND fa.asset_id = fat.asset_id
                                   --AND facc.asset_type <> 'CAPITALIZED'
                                   AND fb.deprn_method_code = fm.method_code
                                   AND ds.deprn_source_code <> 'BOOKS'
                                   AND DECODE (
                                         facc.asset_type || '-' || fc.segment1,
                                         'CIP-0012',
                                         'Additions Project Khalifa assets',
                                         'CAPITALIZED-' || fc.segment1,
                                         '0',
                                         'Additions'
                                      ) <> '0'/*ORDER BY fb.asset_id*/
                UNION
                -- Disposal / Transferred / Retired
                (                                                       -- retired
                 SELECT   DISTINCT asset_id,
                                   cost,
                                   ytd_deprn,
                                   deprn_amount,
                                   deprn_reserve acc_deprn,
                                   cost - deprn_reserve net_bk_val,
                                   cip_cost,
                                   cip_cost_pk,
                                   description cat_desc,
                                   fat_desc sub_cat_desc,
                                   activity
                   FROM   (SELECT   DISTINCT
                                    fb.asset_id,
                                    fb.cost,
                                    0 cip_cost,
                                    0 cip_cost_pk,
                                    ds.ytd_deprn,
                                    ds.deprn_reserve,
                                    fc.description,
                                    fat.description fat_desc,
                                    ds.deprn_amount,
                                    'Disposal / Transferred / Retired' activity
                             FROM   fa_books fb,
                                    fa_additions_b fa,
                                    fa_methods fm,
                                    fa_financial_inquiry_cost_v fic,
                                    fa_categories_vl fc,
                                    fa_additions_tl fat,
                                    fa_deprn_summary ds,
                                    fa_mass_ext_retirements_v ret
                            WHERE       ds.asset_id = fa.asset_id
                                    AND fb.asset_id = fa.asset_id
                                    AND fb.asset_id = fic.asset_id
                                    AND fb.life_in_months = fm.life_in_months
                                    AND fb.book_type_code = ds.book_type_code
                                    AND fb.book_type_code = fic.book_type_code
                                    AND fa.last_update_date >
                                          TO_DATE (
                                                '01'
                                             || 'JAN'
                                             || TO_CHAR (SYSDATE, 'RRRR'),
                                             'DD-MON-RRRR'
                                    AND ds.deprn_run_date =
                                          (SELECT   DISTINCT MAX (deprn_run_date)
                                             FROM   fa_deprn_summary
                                            WHERE   asset_id = fb.asset_id)
                                    AND fic.transaction_header_id_in =
                                          (SELECT   DISTINCT
                                                    MAX (transaction_header_id_in)
                                             FROM   fa_financial_inquiry_cost_v
                                            WHERE   asset_id = fb.asset_id)
                                    AND fb.date_effective =
                                          (SELECT   DISTINCT MAX (date_effective)
                                             FROM   fa_books
                                            WHERE   asset_id = fb.asset_id)
                                    AND fa.attribute_category_code =
                                          fc.segment1 || '-' || fc.segment2
                                    AND fb.asset_id = ret.asset_id
                                    AND fa.asset_id = fat.asset_id
                                    AND fb.deprn_method_code = fm.method_code
                                    AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
                 UNION
                 --transfer
                 SELECT   DISTINCT asset_id,
                                   cost,
                                   ytd_deprn,
                                   deprn_amount,
                                   deprn_reserve acc_deprn,
                                   cost - deprn_reserve net_bk_val,
                                   cip_cost,
                                   cip_cost_pk,
                                   description cat_desc,
                                   fat_desc sub_cat_desc,
                                   activity
                   FROM   (SELECT   DISTINCT
                                    fb.asset_id,
                                    fb.cost,
                                    facc.cost cip_cost,
                                    0 cip_cost_pk,
                                    ds.ytd_deprn,
                                    ds.deprn_reserve,
                                    fc.description,
                                    fat.description fat_desc,
                                    ds.deprn_amount,
                                    'Disposal / Transferred / Retired' activity
                             FROM   fa_books fb,
                                    fa_additions_b fa,
                                    fa_methods fm,
                                    fa_financial_inquiry_cost_v fic,
                                    fa_categories_vl fc,
                                    fa_capitalize_cip_v facc,
                                    fa_additions_tl fat,
                                    fa_deprn_summary ds,
                                    fa_distribution_inquiry_v di
                            WHERE       ds.asset_id = fa.asset_id
                                    AND fb.asset_id = fa.asset_id
                                    AND fb.asset_id = fic.asset_id
                                    AND di.asset_id = fb.asset_id
                                    AND fb.life_in_months = fm.life_in_months
                                    AND fb.book_type_code = ds.book_type_code
                                    AND fb.book_type_code = fic.book_type_code
                                    AND fa.last_update_date >
                                          TO_DATE (
                                                '01'
                                             || 'JAN'
                                             || TO_CHAR (SYSDATE, 'RRRR'),
                                             'DD-MON-RRRR'
                                    AND ds.deprn_run_date =
                                          (SELECT   DISTINCT MAX (deprn_run_date)
                                             FROM   fa_deprn_summary
                                            WHERE   asset_id = fb.asset_id)
                                    AND fic.transaction_header_id_in =
                                          (SELECT   DISTINCT
                                                    MAX (transaction_header_id_in)
                                             FROM   fa_financial_inquiry_cost_v
                                            WHERE   asset_id = fb.asset_id)
                                    AND fb.date_effective =
                                          (SELECT   DISTINCT MAX (date_effective)
                                             FROM   fa_books
                                            WHERE   asset_id = fb.asset_id)
                                    AND di.transaction_header_id =
                                          (SELECT   DISTINCT
                                                    MAX (transaction_header_id)
                                             FROM   fa_distribution_inquiry_v
                                            WHERE   asset_id = fb.asset_id
                                                    AND transtype = 'TRANSFER')
                                    AND fa.attribute_category_code =
                                          fc.segment1 || '-' || fc.segment2
                                    AND fb.asset_id = facc.asset_id
                                    AND fa.asset_id = fat.asset_id
                                    AND facc.asset_type = 'CAPITALIZED'
                                    AND fb.deprn_method_code = fm.method_code
                                    AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
    GROUP BY   cat_desc, activity                                   
    ORDER BY   activityBrgds,
    Max

    Hi all,
    I have a matrix report which has dynamic as well as few fixed columns.
    It is a fixed asset Report in which the sum(cost) in cell should be grouped according to column and row-wise.
    The row consists of the activity such as additions, retirements etc and the dynamic column is the category and other fixed columns such as CIP cost, CWIP cost will be grouped only according to row.
    the actual layout should be like this
                     | category 1 | category 2 | category 3 ...... | CIP cost | CWIP cost
    Additions    | Sum(cost) | Sum(cost)  | Sum(cost)  .......| 1234      | 4500
    retirements | Sum(cost) | Sum(cost)  | Sum(cost)  .......| 1000      | 2500but due to fixed colums in the layout the report builder pushes the fixed colums to the next row with single query i get
                     | category 1 | category 2 | category 3 ...... |
    Additions    | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
                      CIP cost     | CWIP cost
                       1234        | 4500
    retirements | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
                      CIP cost     | CWIP cost
                       1000        | 2500if i try to add those columns alone in a seperate query and then build the report i get the layout like this
                     | category 1 | category 2 | category 3 ...... |
    Additions    | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
    retirements | Sum(cost) | Sum(cost)  | Sum(cost)  .......|
    CIP cost     | CWIP cost
    2234        | 7000This is my query, i have used union to get the row-wise column activity
    /* Formatted on 03-Sep-12 5:23:11 PM (QP5 v5.114.809.3010) */
      SELECT   DISTINCT /*ASSET_ID
                        SUM (cost),
                        SUM (cip_cost),
                        SUM (cip_cost_pk),
                        cat_desc--,sub_cat_desc
                        ,activity
        FROM   (-- cip cost
                SELECT   DISTINCT asset_id,
                                  cost,
                                  ytd_deprn,
                                  deprn_amount,
                                  deprn_reserve acc_deprn,
                                  cost - deprn_reserve net_bk_val,
                                  cip_cost,
                                  cip_cost_pk,
                                  description cat_desc,
                                  fat_desc sub_cat_desc,
                                  activity
                  FROM   (SELECT   DISTINCT
                                   fb.asset_id,
                                   fb.cost,
                                   facc.cost cip_cost,
                                   0 cip_cost_pk,
                                   ds.ytd_deprn,
                                   ds.deprn_reserve,
                                   fc.description,
                                   fat.description fat_desc,
                                   ds.deprn_amount,
                                   DECODE (
                                         facc.asset_type
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || di.transtype,
                                         'CIP'
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || 'TRANSFER',
                                      'CIP T/F',
                                      'CIP-0012-' || di.transtype,
                                      'Additions Project Khalifa assets',
                                      'CAPITALIZED-' || fc.segment1 || di.transtype,
                                      '0',
                                      'Additions'
                                      activity
                            FROM   fa_books fb,
                                   fa_additions_b fa,
                                   fa_methods fm,
                                   fa_financial_inquiry_cost_v fic,
                                   fa_categories_vl fc,
                                   fa_capitalize_cip_v facc,
                                   fa_additions_tl fat,
                                   fa_deprn_summary ds,
                                   fa_distribution_inquiry_v di
                           WHERE       ds.asset_id = fa.asset_id
                                   AND fb.asset_id = fa.asset_id
                                   AND fb.asset_id = fic.asset_id
                                   AND di.asset_id = fb.asset_id
                                   AND fb.life_in_months = fm.life_in_months
                                   AND fb.book_type_code = ds.book_type_code
                                   AND fb.book_type_code = fic.book_type_code
                                   AND fa.last_update_date >
                                         TO_DATE (
                                               '01'
                                            || 'JAN'
                                            || TO_CHAR (SYSDATE, 'RRRR'),
                                            'DD-MON-RRRR'
                                   AND ds.deprn_run_date =
                                         (SELECT   DISTINCT MAX (deprn_run_date)
                                            FROM   fa_deprn_summary
                                           WHERE   asset_id = fb.asset_id)
                                   AND fic.transaction_header_id_in =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id_in)
                                            FROM   fa_financial_inquiry_cost_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fb.date_effective =
                                         (SELECT   DISTINCT MAX (date_effective)
                                            FROM   fa_books
                                           WHERE   asset_id = fb.asset_id)
                                   AND di.transaction_header_id =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id)
                                            FROM   fa_distribution_inquiry_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fa.attribute_category_code =
                                         fc.segment1 || '-' || fc.segment2
                                   AND fc.segment1 <> '0012'
                                   AND fb.asset_id = facc.asset_id
                                   AND fa.asset_id = fat.asset_id
                                   --AND facc.asset_type <> 'CAPITALIZED'
                                   AND fb.deprn_method_code = fm.method_code
                                   AND ds.deprn_source_code <> 'BOOKS'
                                   AND DECODE (
                                         facc.asset_type || '-' || fc.segment1,
                                         'CIP-0012',
                                         'Additions Project Khalifa assets',
                                         'CAPITALIZED-' || fc.segment1,
                                         '0',
                                         'Additions'
                                      ) <> '0'/*ORDER BY fb.asset_id*/
                UNION
                --cip cost pk
                SELECT   DISTINCT asset_id,
                                  cost,
                                  ytd_deprn,
                                  deprn_amount,
                                  deprn_reserve acc_deprn,
                                  cost - deprn_reserve net_bk_val,
                                  cip_cost,
                                  cip_cost_pk,
                                  description cat_desc,
                                  fat_desc sub_cat_desc,
                                  activity
                  FROM   (SELECT   DISTINCT
                                   fb.asset_id,
                                   fb.cost,
                                   0 cip_cost,
                                   facc.cost cip_cost_pk,
                                   ds.ytd_deprn,
                                   ds.deprn_reserve,
                                   fc.description,
                                   fat.description fat_desc,
                                   ds.deprn_amount,
                                   DECODE (
                                         facc.asset_type
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || di.transtype,
                                         'CIP'
                                      || '-'
                                      || fc.segment1
                                      || '-'
                                      || 'TRANSFER',
                                      'CIP T/F',
                                      'CIP-0012-' || di.transtype,
                                      'Additions Project Khalifa assets',
                                      'CAPITALIZED-' || fc.segment1 || di.transtype,
                                      '0',
                                      'Additions'
                                      activity
                            FROM   fa_books fb,
                                   fa_additions_b fa,
                                   fa_methods fm,
                                   fa_financial_inquiry_cost_v fic,
                                   fa_categories_vl fc,
                                   fa_capitalize_cip_v facc,
                                   fa_additions_tl fat,
                                   fa_deprn_summary ds,
                                   fa_distribution_inquiry_v di
                           WHERE       ds.asset_id = fa.asset_id
                                   AND fb.asset_id = fa.asset_id
                                   AND fb.asset_id = fic.asset_id
                                   AND di.asset_id = fb.asset_id
                                   AND fb.life_in_months = fm.life_in_months
                                   AND fb.book_type_code = ds.book_type_code
                                   AND fb.book_type_code = fic.book_type_code
                                   AND fa.last_update_date >
                                         TO_DATE (
                                               '01'
                                            || 'JAN'
                                            || TO_CHAR (SYSDATE, 'RRRR'),
                                            'DD-MON-RRRR'
                                   AND ds.deprn_run_date =
                                         (SELECT   DISTINCT MAX (deprn_run_date)
                                            FROM   fa_deprn_summary
                                           WHERE   asset_id = fb.asset_id)
                                   AND fic.transaction_header_id_in =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id_in)
                                            FROM   fa_financial_inquiry_cost_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fb.date_effective =
                                         (SELECT   DISTINCT MAX (date_effective)
                                            FROM   fa_books
                                           WHERE   asset_id = fb.asset_id)
                                   AND di.transaction_header_id =
                                         (SELECT   DISTINCT
                                                   MAX (transaction_header_id)
                                            FROM   fa_distribution_inquiry_v
                                           WHERE   asset_id = fb.asset_id)
                                   AND fa.attribute_category_code =
                                         fc.segment1 || '-' || fc.segment2
                                   AND fc.segment1 = '0012'
                                   AND fb.asset_id = facc.asset_id
                                   AND fa.asset_id = fat.asset_id
                                   --AND facc.asset_type <> 'CAPITALIZED'
                                   AND fb.deprn_method_code = fm.method_code
                                   AND ds.deprn_source_code <> 'BOOKS'
                                   AND DECODE (
                                         facc.asset_type || '-' || fc.segment1,
                                         'CIP-0012',
                                         'Additions Project Khalifa assets',
                                         'CAPITALIZED-' || fc.segment1,
                                         '0',
                                         'Additions'
                                      ) <> '0'/*ORDER BY fb.asset_id*/
                UNION
                -- Disposal / Transferred / Retired
                (                                                       -- retired
                 SELECT   DISTINCT asset_id,
                                   cost,
                                   ytd_deprn,
                                   deprn_amount,
                                   deprn_reserve acc_deprn,
                                   cost - deprn_reserve net_bk_val,
                                   cip_cost,
                                   cip_cost_pk,
                                   description cat_desc,
                                   fat_desc sub_cat_desc,
                                   activity
                   FROM   (SELECT   DISTINCT
                                    fb.asset_id,
                                    fb.cost,
                                    0 cip_cost,
                                    0 cip_cost_pk,
                                    ds.ytd_deprn,
                                    ds.deprn_reserve,
                                    fc.description,
                                    fat.description fat_desc,
                                    ds.deprn_amount,
                                    'Disposal / Transferred / Retired' activity
                             FROM   fa_books fb,
                                    fa_additions_b fa,
                                    fa_methods fm,
                                    fa_financial_inquiry_cost_v fic,
                                    fa_categories_vl fc,
                                    fa_additions_tl fat,
                                    fa_deprn_summary ds,
                                    fa_mass_ext_retirements_v ret
                            WHERE       ds.asset_id = fa.asset_id
                                    AND fb.asset_id = fa.asset_id
                                    AND fb.asset_id = fic.asset_id
                                    AND fb.life_in_months = fm.life_in_months
                                    AND fb.book_type_code = ds.book_type_code
                                    AND fb.book_type_code = fic.book_type_code
                                    AND fa.last_update_date >
                                          TO_DATE (
                                                '01'
                                             || 'JAN'
                                             || TO_CHAR (SYSDATE, 'RRRR'),
                                             'DD-MON-RRRR'
                                    AND ds.deprn_run_date =
                                          (SELECT   DISTINCT MAX (deprn_run_date)
                                             FROM   fa_deprn_summary
                                            WHERE   asset_id = fb.asset_id)
                                    AND fic.transaction_header_id_in =
                                          (SELECT   DISTINCT
                                                    MAX (transaction_header_id_in)
                                             FROM   fa_financial_inquiry_cost_v
                                            WHERE   asset_id = fb.asset_id)
                                    AND fb.date_effective =
                                          (SELECT   DISTINCT MAX (date_effective)
                                             FROM   fa_books
                                            WHERE   asset_id = fb.asset_id)
                                    AND fa.attribute_category_code =
                                          fc.segment1 || '-' || fc.segment2
                                    AND fb.asset_id = ret.asset_id
                                    AND fa.asset_id = fat.asset_id
                                    AND fb.deprn_method_code = fm.method_code
                                    AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
                 UNION
                 --transfer
                 SELECT   DISTINCT asset_id,
                                   cost,
                                   ytd_deprn,
                                   deprn_amount,
                                   deprn_reserve acc_deprn,
                                   cost - deprn_reserve net_bk_val,
                                   cip_cost,
                                   cip_cost_pk,
                                   description cat_desc,
                                   fat_desc sub_cat_desc,
                                   activity
                   FROM   (SELECT   DISTINCT
                                    fb.asset_id,
                                    fb.cost,
                                    facc.cost cip_cost,
                                    0 cip_cost_pk,
                                    ds.ytd_deprn,
                                    ds.deprn_reserve,
                                    fc.description,
                                    fat.description fat_desc,
                                    ds.deprn_amount,
                                    'Disposal / Transferred / Retired' activity
                             FROM   fa_books fb,
                                    fa_additions_b fa,
                                    fa_methods fm,
                                    fa_financial_inquiry_cost_v fic,
                                    fa_categories_vl fc,
                                    fa_capitalize_cip_v facc,
                                    fa_additions_tl fat,
                                    fa_deprn_summary ds,
                                    fa_distribution_inquiry_v di
                            WHERE       ds.asset_id = fa.asset_id
                                    AND fb.asset_id = fa.asset_id
                                    AND fb.asset_id = fic.asset_id
                                    AND di.asset_id = fb.asset_id
                                    AND fb.life_in_months = fm.life_in_months
                                    AND fb.book_type_code = ds.book_type_code
                                    AND fb.book_type_code = fic.book_type_code
                                    AND fa.last_update_date >
                                          TO_DATE (
                                                '01'
                                             || 'JAN'
                                             || TO_CHAR (SYSDATE, 'RRRR'),
                                             'DD-MON-RRRR'
                                    AND ds.deprn_run_date =
                                          (SELECT   DISTINCT MAX (deprn_run_date)
                                             FROM   fa_deprn_summary
                                            WHERE   asset_id = fb.asset_id)
                                    AND fic.transaction_header_id_in =
                                          (SELECT   DISTINCT
                                                    MAX (transaction_header_id_in)
                                             FROM   fa_financial_inquiry_cost_v
                                            WHERE   asset_id = fb.asset_id)
                                    AND fb.date_effective =
                                          (SELECT   DISTINCT MAX (date_effective)
                                             FROM   fa_books
                                            WHERE   asset_id = fb.asset_id)
                                    AND di.transaction_header_id =
                                          (SELECT   DISTINCT
                                                    MAX (transaction_header_id)
                                             FROM   fa_distribution_inquiry_v
                                            WHERE   asset_id = fb.asset_id
                                                    AND transtype = 'TRANSFER')
                                    AND fa.attribute_category_code =
                                          fc.segment1 || '-' || fc.segment2
                                    AND fb.asset_id = facc.asset_id
                                    AND fa.asset_id = fat.asset_id
                                    AND facc.asset_type = 'CAPITALIZED'
                                    AND fb.deprn_method_code = fm.method_code
                                    AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
    GROUP BY   cat_desc, activity                                   
    ORDER BY   activityBrgds,
    Max

Maybe you are looking for