Group matrix report with an hierarchy table???

Hello,
I have a big trouble making up a report involving many tables and one of them having a many-to-many recursive relationship. The user has a defined request in having the information grouped.I'll give some more details. I would like to know if you have any ideas in how to structure the report..
Here are the tables:
ORG
(org_id not null,
org_name not null)
DNR
(dnr_id not null,
org_id not null,
dnr_age,
dnr_gender)
CS
(cs_id not null,
dnr_id not null)
Smpl
(smpl_id not null,
dnr_id notnull,
org_id,
smpl_tp not null,
cs_id,
meth,
notes)
Tr_map
(tr_id not null,
smpl_prnt not null,
smpl_chld,
pos)
Some data..
Smpl_id Dnr_id Org_id Smpl_tp Cs_id Meth Notes
107 101 137 tss a xxxx
118 112 137 tss ab xxxx
122 108 25 tss 3768 a xxxx
123 108 25 tss 3768 ab xxxx
124 108 25 blk c yyyy
125 108 25 sld d zzzz
126 108 25 blk c yyyy
tr_id Smpl_prnt Smpl_chld Pos
1 107
2 118
3 122
4 123
5 124 122 1
7 125 124 1
8 126 122 1
10 125 126 2
The user wants the data reported as follows:
Org name
Dnr_id, dnr_age etc...
Cs_id
Smpl_id, Smpl_tp (tss), Meth, Notes
Smpl_id,smpl_tp(blk), Meth, Notes ...
Smpl_id, smpl_tp(sld), Meth, Notes...
Cs_id
Smpl_id, Smpl_tp (tss), Meth, Notes
Smpl_id, smpl_tp(blk), Meth,Notes...
Smpl_id, smpl_tp(sld), Meth, Notes...
I think the grouped matrix would be the solution but I don't know how to do that with the hierarchy table to show the children and grandchildren as subgroups. Is that possible in a single query? How can I build a group matrix with multiple subgroups?
Thanks in advance.
simona
null

The example given by Oracle (from the above link) using the following SQL for a matrix report is flawed.
SELECT DEPTNO, JOB, SUM(SAL)
FROM EMP
GROUP BY DEPTNO, JOB
ORDER BY DEPTNO, JOB
The SUM function handled by the query restricts you from doing so many things - especially when you want the empty fields to be filled by 0 (by using the Value if Null property).
If the query is changed to ''SELECT DEPTNO, JOB, SAL FROM EMP' , and use the SUM function in the wizard to build the Matrix cell, then the 'Value if Null' property can be used without any issues.
This also makes Section 25.6 (Add zeroes in place of blanks) of the documentation a joke.
Anyway, that's my cents worth....

Similar Messages

  • Matrix report with group.

    dear all,
    can anyone guide me how to build a matrix report with group using scott schema.
    i can not be able to build a query.
    Thanks
    Muhammad Nadeem

    The example given by Oracle (from the above link) using the following SQL for a matrix report is flawed.
    SELECT DEPTNO, JOB, SUM(SAL)
    FROM EMP
    GROUP BY DEPTNO, JOB
    ORDER BY DEPTNO, JOB
    The SUM function handled by the query restricts you from doing so many things - especially when you want the empty fields to be filled by 0 (by using the Value if Null property).
    If the query is changed to ''SELECT DEPTNO, JOB, SAL FROM EMP' , and use the SUM function in the wizard to build the Matrix cell, then the 'Value if Null' property can be used without any issues.
    This also makes Section 25.6 (Add zeroes in place of blanks) of the documentation a joke.
    Anyway, that's my cents worth....

  • Matrix report with two across groups

    Hi all,
    I am facing a problem in making a multi line matrix report.
    actually I need to make a matrix report with two "across groups", but unable to get desired result.
    if any body has any idea, please share with me.
    regards
    Ata

    No,
    you must have only 1 query which extracts all your data:
    A,q1,10
    A,q2,20
    A,q3,30
    B,q1,40
    B,q3,50
    C,q2,60
    C,q3,70
    Open report builder and create a new report from wizard.
    Select the first option accordingly with your requirements and go next.
    Type a name for your report in the title field then select "Matrix" as layout and go next.
    Select SQL Query and go next.
    Type your query.
    Select the data you want on the rows (i.e. A, B, C...) and click on the ">" button in the Matrix Row Fields section, then go next.
    Select the data you want on the columns (i.e. q1, q2, q3...) and click on the ">" button in the Matrix Column Fields section, then go next.
    Select the data you want on the cells(i.e. 10,20,30...) and click on the "Sum >" button in the Matrix Cell Fields section, then go next.
    Add some totals, if you need them.
    Go next and finish.
    Now you have a report with the following layout:
             Q1           Q2            Q3       TOT
    A        10           20            30        60
    B        40                         50        90
    C                     60            70       130
    TOT      50           80           150       280Bye
    Raffy

  • Report with custom hierarchy

    Hi experts!
    I have an assignment to do.
    My clients wants a report with a hierarchy but he wants to see "Total" on last row of a table.
    My hierarchy is:
    +Total
    ---Level1
    ---Level2
    -----Level2.1
    My analysis should to see:
    LevelA1 (Can Drill)
    LevelA2 (Can Drill)
    Level 2.1 (Can Drill)
    Total (No Drill)
    In selection steps pane:
    1. Start with all members
    2. Then, Keep all members of: LevelA levels
    I think that I have another step to show TOTAL and no drill
    Is that possible???

    Yes we can do this:?
    Create a hierarchy accordingly and go to col properties there u have a interaction option check the drill option accordingly for what all columns u need a drill down keep that.Do and let me know for any updates
    If helps mark as correct :)

  • How to load Matrix report data into basic table data using ODI

    Hi,
    How to load Matrix report data into basic table data using oracle Data Integrator ?
    Requirement Description:
    Following is the matrix report data:
    JOB                       DEPT10                DEPT20 
    ANALYST                                           6000
    CLERK                   1300                     1900 Need to convert it into below format:
    JOB                             Dept                        Salary
    ANALYST                  DEPT10     
    ANALYST                  DEPT20                     6000
    CLERK                       DEPT10                    1300
    CLERK                       DEPT20                    1900
        Thanks for your help in advance. Let me know if any further explanation is required.

    Your list seems to be a little restrictive, you can do a lot more with ODI procedures.
    If you create new procedure, and add a step. In the 'command on source' tab set you technology and schema as per your source database. Use the unpivot functionality as described in the link, please, rather than using 'SELECT *' use the appropriate column names and alias them for eg:
    SELECT job as job,
    deptsal as deptsal,
    saldesc as saledesc
    FROM pivoted_data
    UNPIVOT (
    deptsal --<-- unpivot_clause
    FOR saldesc --<-- unpivot_for_clause
    IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
    Then in your 'command on target' tab set the technology and schema to your target db, then put your INSERT statement for eg:
    INSERT INTO job_sales
    (job,
    deptsal,
    saledesc
    VALUES
    :job,
    :deptsal,
    :saledesc
    Therefore you are using bind variables from source to load data into target.
    Obviously if the source and target table are in the same database, then you can have it all in one statement in the 'command on target' as
    INSERT INTO job_sales
    (job,
    deptsal,
    saledesc
    SELECT job as job,
    deptsal as deptsal,
    saldesc as saledesc
    FROM pivoted_data
    UNPIVOT (
    deptsal --<-- unpivot_clause
    FOR saldesc --<-- unpivot_for_clause
    IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
    also set the log counter as 'Insert' on the tab where your INSERT statement is, so you know how many rows you insert into the table.
    Hope this helps.
    BUT remember that this feature only came out in Oracle 11g.

  • How to make Group Matrix Report in BI Publisher Template Builder for Word

    Dear All
    I have created a template in MSWord's BI Publisher for creating Matrix report, it is working fine, but i couldn't do it for Group matrix report. Kindly give me any kind of example regarding group matrix or nested group in column level and row level.
    Regards
    Haq Nawaz
    A.F.Ferguson & Co
    Edited by: 823804 on Dec 28, 2010 5:42 PM

    Hey hi,
    I m also trying to create template for matrix wih group. have you found any solution for this? if yes please forward me the information on my mail id [email protected]

  • Group By reports with Serial Numbers

    hi,
    i am creating group by reports with serial numbers. i use the
    following code to generate the serial numbers using a formula
    column:
    function SNOFormula return Number is
    SNO NUMBER(5);
    begin
    SNO := :SNO + 1;
    RETURN(SNO);
    end;
    I am able to acheive the required output with the above code in
    the case of Normal Tablular reports. But in the case of Group by
    reports, the output goes as follows:
    for example:
    sno,groupno,empno
    1,g1,e1
    e2
    e3
    4,g2,e5
    e6
    Any way out?. pls help.
    Regards,
    Prabhu S

    create a summary column in the group . set the function to
    count. set the source to the group name. set the reset at value
    as report. create a field in the lay our editor left of the
    group field. set the source as the summary column. you will see
    the numbering.
    Ex :
    Query : Select * From Emp;
    Group Field : Deptno
    Summary Field : CS_Count
    Properties of Cs_Count - Function => Count
    Source => DEPTNO
    Reset At => Report
    Now create a field in the lay out editor left side of deptno
    field lets say "SEQ", set the source to Cs_Count.
    It will disply the serial number of the groups.

  • Cant use more than one authorization group per report with SBO CR Basic

    Cant use more than one authorization group per report with SBO CR Basic.
    I have installed on SAP Business One SBO 2007 SP00 PL49 the Crystal Reports Basic 2.0.0.7.
    i have defined two users, manager and supervisor.
    I have defined two groups, M and S.
    Manager belongs in managers (M), and supervisor is assigned to the supervisors (S).
    i enter to one report, disable the public option to enable group authorization, and then check M group.
    Manager can see the report, but Supervisor is not allowed. So far good.
    Then i uncheck M, then check S in the report properties, and Manager cant get in, supervisor opens the report, So far good.
    But when we check both Groups or more, only the M group authorization appears to work, and S group users cant acess, even the report is allowed for that group, also happens with all the groups appart the first (2nd, 3rd, 4th, etc.).
    It seems that a report can manage a single group, but i have to be shure to tell this to the customer.
    So far we have included all Manager users to the S group in order that only S group is used and authorized users can use, but this is duplicating user participation in groups, and it would be much easier to check the desired groups for a single report.

    Cant use more than one authorization group per report with SBO CR Basic.
    I have installed on SAP Business One SBO 2007 SP00 PL49 the Crystal Reports Basic 2.0.0.7.
    i have defined two users, manager and supervisor.
    I have defined two groups, M and S.
    Manager belongs in managers (M), and supervisor is assigned to the supervisors (S).
    i enter to one report, disable the public option to enable group authorization, and then check M group.
    Manager can see the report, but Supervisor is not allowed. So far good.
    Then i uncheck M, then check S in the report properties, and Manager cant get in, supervisor opens the report, So far good.
    But when we check both Groups or more, only the M group authorization appears to work, and S group users cant acess, even the report is allowed for that group, also happens with all the groups appart the first (2nd, 3rd, 4th, etc.).
    It seems that a report can manage a single group, but i have to be shure to tell this to the customer.
    So far we have included all Manager users to the S group in order that only S group is used and authorized users can use, but this is duplicating user participation in groups, and it would be much easier to check the desired groups for a single report.

  • Group Matrix Report Problem

    when i build a group matrix report ,i only able to get the summary totals of columns (in the cross product ) at group level,but fail to get the summary totals of columns (in the cross product) at report level.So please tell me , how can i achieve this one?

    Dear Waheed....I think u just have to set property of summary column
    'Reset at = Report'
    I this does'nt work then u should explain ur problem.
    Kashif

  • Tree Matrix Report with double line heading

    Hi,
    I am very new to HTML-DB and HTML as well.
    I need to create a matrix report with a tree functionality and with two line heading.
    Basically This is what I need to generate
    REGION1 REGION2 REGION3
    COL1 COL2 TOTAL COL1 COL2 TOTAL COL1 COL2 TOTAL
    ===========================================================
    CAT1+
    Sub_CAT1
    Sub_CAT2
    CAT2+
    Sub_SCAT3
    Sub_SCAT4
    Where CAT1 , CAT2 needs to be collapsible rows. SCAT1..SCAT4 are sub categories under main categories.
    REGION1.... REGION3 are top level headings. And COL1,COL2 are sub headings under top level headings.
    Thanks,
    Shri

    Please help me on this!
    Thanks,
    Shri

  • Calculate percentage between two rows in a matrix report with a single row group in SSRS 2008

    I need your help. I have a matrix report in ssrs 2008. The report contain one field value column and one value column. I need to calculate a percentage for two values. For example : row 1 : Discount 10 Row 2 : Sales 100 Result : 10/100. I have only one
    row group, I need to have a condition where Field = Discount % on Revenue then Discount/Total Turnover. Because of the  grouping for total, I am not being able to calculate the %, its just totalling the % discount. Kindly refer to the snapshot of the
    report.

    Hi Thanks a lot for your answer, but unfortunately it didn't work,the report is reading from a stored procedure which I have unpivot to convert all columns into rows, so that's why Discount % on Revenue, Discount and Total Turnover is found in one column.
    So the Field!Col.Value is the Discount % on Revenue, Discount and Total Turnover. I have tried to change the code to
    "=SUM(IIF(Fields!Col.Value = "Discount",Fields!value.Value),0))
    /IIF(SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)) = 0 ,
    Nothing,SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)))" but to no avail. Any other suggestion will be most welcome.
    Thanks.
    If everything you're getting from stored procedure then you need to calculate and bring the value from there itself.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • 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

  • Matrix Report with variable@incontext not working

    I had built a matrix report, using variable@incontext. I'm having a problem with my cell data. It seems that it is always using the value from the first record in the column instead of the actual value.
    ie in the example below, the data should make it come out like:
    Staff____01____02____03______
    Bob_____Bob_________Bob
    John____John__John___John
    Joe_____Joe___Joe____Joe
    but it's coming out like this (the data for John is wrong in column1 and 3 and the data for Joe is wrong in all columns) :
    Staff____01____02____03______
    Bob_____Bob_________Bob
    John____Bob___John___Bob
    Joe_____Bob___John___Bob
    Staff Column(Down):
    <?for-each-group:ROWSET2_ROW;./STAFF_NAME?><?variable@incontext:STAFF;STAFF_NAME?>
    <?STAFF_NAME?>
    Number Column (Across)
    <?for-each-group@cell://ROWSET2_ROW;PERIOD?>
    <?sort:current-group()/PERIOD;'ascending';data-type='text'?>
    <?if:count(current-group()[STAFF_NAME=$STAFF])?><?STAFF_NAME?><?end if?>
    <?end for-each-group?>
    <?end for-each-group?>
    It looks like the value for '$STAFF' and ?STAFF_NAME are not right when there was data in a previous column.
    Can anybody Help me?

    Hi,
    Can you please help me to solve the problem.
    Thanks in Advance
    Adina.

  • Report with top 10 tables ...

    Hello !
    I need to create an report with the top 10 tables :
    1 - The most bigger tables
    2 - The most access tables
    3 - The bigger number of sorts
    4 - The physical access
    5 - The bigger shared memory use
    The first one i can get from dba_segments, but the others i have no clue where i can find this informatation on the database.
    Any help is good .
    thanks
    Fernando

    Hi
    Answer of your first point is hidden in dba_segments view. this view contain colum bytes. it is size of any objects in bytes
    like select segment_name,segment_type,owner,bytes/1024/1024 as size_in_mb
    from dba_segments
    where owner='SCOTT'
    order by bytes desc.
    Answer Point No. 2
    there is dynamic view v$sql
    this view contain a colums sql_text,first_load_time, last_load_time
    select colums sql_text,first_load_time, last_load_time
    from v$sql
    order by sql_text
    copy colum sql_text in excel sheet and you can count table name how many time it has been accessed. or by apply a group funcation
    select select count(*) from v$sql
    from v$sql
    group by sql_text
    Answer of point No. 3,4,5 lies in a statspack report. in oracle 9 and 10g contain following information in automaitc work load repository reprot.
    Best Regard
    Abdul Hameed
    Islamabad Pakistan
    [email protected]
    cell 92 333 5587 318

  • Group matrix  report

    Hi, I am working on a report with the following example layout...
    customer1
    .............1kg 5kg 10kg Total 1kg 5kg
    contract1
    contract2
    estimate1
    estimate2
    actual1
    actual2
    totals
    customer2
    .............1kg 5kg 10kg Total 1kg 5kg
    contract1
    contract2
    estimate1
    estimate2
    actual1
    actual2
    totals
    The kg columns are fetched from a column in the database. These are dynamic and can vary. All to the left of total are for a particular type of product and those to the right are another. So far I have managed to create the matrix for contracts only and up to the totals column.
    I thought I should have one query for the customers then outer join customer code to another query for the matrix. The matrix will need to use a union for the contracts, estimates and actuals tables. Please advise whether this is the best solution. As yet I am unable to implement it to completion.
    Thanks in advance.
    Nick.

    Rana,
    You can use formula columns and summary columns with placeholders to get totals at report level.
    Hope this helps
    Tony S. Garabedian

Maybe you are looking for

  • System copy for PI 7.0 system

    Hi, We are doing system copy for complete landscape and every time we used to perform PI system copy using SAP standard procedure of backup/restore, Java  exp/imp. But can we use another approach of exporting IR/ID from source to Target. Because we d

  • Hard disk info not visible on the bios menu

    on my Compaq CQ58-200ei the hdd is not shown..does this mean that there is a problem with the drive? This occurred after it has displayed a black screen. This question was solved. View Solution.

  • Pdf form fields

    I have a report that i output as pdf. is it possible to include a form field in a pdf output such that i can download the Report and type some comments in the form field and save the document?

  • Better slideshow product out there?

    Just looking for a little advice from those who have working with picutes and other software as well. I'm new to saving and displaying pictures on my computer. I bought PS3, thinking it was the best software out there in saving and presenting picture

  • Printing as PDF doens't have "Full Quality" Option

    Not sure if this pertains more to Illustrator or to Acrobat. I work at a print shop and we have 4 computers. Whenever I design something in Illustrator I will save it as a PDF by going to File > Print and selecting the Adobe PDF setting. On that scre