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....

Similar Messages

  • 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 grouping issue

    I have a report which have year(2008), Category(0-1,2-3, ALL), product(0,1,2,3,4..), % sales. I group by all the category elements and called it as All, I am not getting the right percentage sales for the Category ALL other wise for 0-1,2-3 i am getting it right. Please advise where i am doing it wrong. please find the blog for a screen shot of my issue.
    http://ravibiblog.blogspot.com/2012/04/report-with-grouping-issue.html
    Thanks,
    RC

    Pl post details of OS, database and EBS versions. Pl see if these MOS Docs can help
    FARXPBSH Failing With "Program was terminated by signal 11" or "Program was terminated by signal 10"          (Doc ID 742729.1)
    Publishing RXAPPYAC: The FARXPBSH Ends With 'Signal 11' Error          (Doc ID 432797.1)
    RXi RX Reports Failing With Program Was Terminated By Signal 10 or 11 Errors After FA Rollup Patch 6          (Doc ID 737963.1)
    Program was Terminated by Signal 11 when Running Rxi Reports          (Doc ID 559425.1)
    HTH
    Srini

  • 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

  • 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....

  • 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.

  • In need help: Analytic Report with Group by

    Good morning,
    I am trying to create a report with subtotal and grand total, which of couse goes to the group by clause, with rollup, cube, grouping... etc. I'd like to use rollup, then some columns in the Select list have to be put into the Group By clause, which is not supposed to be. So I had to use one of SUM, AVG, MIN and MAX functions, to make those columns as *aggregated, which is wrong.
    Another alternative I tried is to use Cube and Grouping_id to be the filter. However, that is still very cumbentsome and error-prone, also the order of the display is absolutely out of control.
    I am trying hard to stick to the first option of using the Rollup, since the result is very close to what I want, but avoid the usage of aggregation functions. For example, if I want to display column A, which should not be grouped. Other than using those aggregation functions, what I can do?
    Thanks in advance.

    Luc,
    this is a simple and a good reference for analytic functions:
    http://www.orafaq.com/node/55
    It takes some time to understand how they work and also it takes some time to understand how to utilize them. I have solved some issues in reporting using them, avoiding the overkill of aggregates.
    Denes Kubicek

  • Aggregrate function in report with group by

    I have SQL report with all the records and Total of some of the fields in end.
    I wanted to group them by item1 and than show the Total for the fields for each Item

    In your report have a break formatting section, select the column you wish to break (sub-total on).. make sur eto set the sum checkbox on the column you ar edoing the break on too! It will then build the sub-total line for you..
    Thank you,
    Tony Miller
    Webster, TX
    Never argue with an idiot. They drag you down to their level, then beat you with experience.
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Matrix Report Row Group Totals

    dear experts,
    I want to create a matrix report for purchase bills in which each bill may have mutiple items with diffrent rate and vat
    i could create the matrix report but the grand total in each purchase master table having column billtotal, vattotal
    the report shows one purchase row and vat column are displayed as multiple colums correctly
    but grand total of billtotal, vattotal gets added as many times as the items are there in that each bill
    any suggestion.
    the data from various tables is attached as an xml and crude method i adopted to overcome the set repetation of masters
    <PurchaseRrgister>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>3</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>1835</supplier_billno>
    <supplier_billdt>2012-03-31</supplier_billdt>
    <amt>28641.6000</amt>
    <z>
    <suppliername>G.R.CORPORATION</suppliername>
    <amount>28080.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>345.60</lstamt>
    <w>
    <vatname>C.S.T. 2%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>CLOTH</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>5</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>71</supplier_billno>
    <supplier_billdt>2012-04-17</supplier_billdt>
    <amt>30365.2700</amt>
    <z>
    <suppliername>GIRIRAJ TRADING COMPANY</suppliername>
    <amount>28919.3000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>136.00</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    <z>
    <suppliername>GIRIRAJ TRADING COMPANY</suppliername>
    <amount>28919.3000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>750.00</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>3</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>8</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>2764</supplier_billno>
    <supplier_billdt>2012-04-13</supplier_billdt>
    <amt>14771.4000</amt>
    <z>
    <suppliername>FAVOURITE BOOK CLOTH &amp; PAPER MART</suppliername>
    <amount>13968.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>98.50</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>CLOTH</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>11</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>176</supplier_billno>
    <supplier_billdt>2012-03-22</supplier_billdt>
    <amt>61248.0000</amt>
    <z>
    <suppliername>VIGNESHWAR HOISERY MFG.</suppliername>
    <amount>61248.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>0.00</lstamt>
    <w>
    <vatname>TAX FREE PURCHASE</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>CLOTH</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>13</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>178</supplier_billno>
    <supplier_billdt>2012-03-24</supplier_billdt>
    <amt>56448.0000</amt>
    <z>
    <suppliername>VIGNESHWAR HOISERY MFG.</suppliername>
    <amount>56448.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>0.00</lstamt>
    <w>
    <vatname>TAX FREE PURCHASE</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>CLOTH</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>15</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>170</supplier_billno>
    <supplier_billdt>2012-03-16</supplier_billdt>
    <amt>58779.0000</amt>
    <z>
    <suppliername>VIGNESHWAR HOISERY MFG.</suppliername>
    <amount>58779.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>0.00</lstamt>
    <w>
    <vatname>TAX FREE PURCHASE</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>CLOTH</glname>
    </f>
    </w>
    <w>
    <vatname>TAX FREE PURCHASE</vatname>
    <syssrl>3</syssrl>
    <f>
    <glname>CLOTH</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>21</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>13</supplier_billno>
    <supplier_billdt>2012-04-05</supplier_billdt>
    <amt>35280.0000</amt>
    <z>
    <suppliername>ROYALTY MINERALS</suppliername>
    <amount>33600.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>520.00</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    <z>
    <suppliername>ROYALTY MINERALS</suppliername>
    <amount>33600.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>375.00</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>3</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    <z>
    <suppliername>ROYALTY MINERALS</suppliername>
    <amount>33600.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>275.00</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>4</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>22</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>14</supplier_billno>
    <supplier_billdt>2012-04-03</supplier_billdt>
    <amt>34102.5300</amt>
    <z>
    <suppliername>GIRIRAJ TRADING COMPANY</suppliername>
    <amount>32478.6000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>1119.93</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    <z>
    <suppliername>GIRIRAJ TRADING COMPANY</suppliername>
    <amount>32478.6000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>204.00</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>3</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>29</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>2695</supplier_billno>
    <supplier_billdt>2012-03-30</supplier_billdt>
    <amt>52349.2200</amt>
    <z>
    <suppliername>VISHVARAJ ENTERPRISES</suppliername>
    <amount>45200.8000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>1682.10</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>30</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>2694</supplier_billno>
    <supplier_billdt>2012-03-30</supplier_billdt>
    <amt>57675.4500</amt>
    <z>
    <suppliername>VISHVARAJ ENTERPRISES</suppliername>
    <amount>49799.6000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>1544.20</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>43</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>2696</supplier_billno>
    <supplier_billdt>2012-03-30</supplier_billdt>
    <amt>46738.6500</amt>
    <z>
    <suppliername>VISHVARAJ ENTERPRISES</suppliername>
    <amount>40300.3000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>1009.26</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    <z>
    <suppliername>VISHVARAJ ENTERPRISES</suppliername>
    <amount>40300.3000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>168.54</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>3</syssrl>
    <f>
    <glname>RAW MATERIAL</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>500</doc_gl>
    <doc_no>58</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>44</supplier_billno>
    <supplier_billdt>2012-04-11</supplier_billdt>
    <amt>1820.2400</amt>
    <z>
    <suppliername>SAI ENTERPRISES</suppliername>
    <amount>1440.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>73.74</lstamt>
    <w>
    <vatname>MVAT 12.5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>REPAIRS &amp; MAINT - MACHINERY</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>501</doc_gl>
    <doc_no>70</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>19601</supplier_billno>
    <supplier_billdt>2012-04-23</supplier_billdt>
    <amt>18678.9400</amt>
    <z>
    <suppliername>KISMAT MACHINARY SALES</suppliername>
    <amount>16603.5000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>1214.81</lstamt>
    <w>
    <vatname>MVAT 12.5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>REPAIRS &amp; MAINT - MACHINERY</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>501</doc_gl>
    <doc_no>71</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>92</supplier_billno>
    <supplier_billdt>2012-04-22</supplier_billdt>
    <amt>5400.0000</amt>
    <z>
    <suppliername>AMIT TOOLS CO.</suppliername>
    <amount>4800.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>237.50</lstamt>
    <w>
    <vatname>MVAT 12.5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>LABORATORY EXPENSES</glname>
    </f>
    </w>
    </z>
    </y>
    <y>
    <doc_gl>501</doc_gl>
    <doc_no>75</doc_no>
    <doc_dt>2012-04-29</doc_dt>
    <supplier_billno>19832</supplier_billno>
    <supplier_billdt>2012-04-27</supplier_billdt>
    <amt>898.8000</amt>
    <z>
    <suppliername>STEEL TRADERS|</suppliername>
    <amount>856.0000</amount>
    <bed_amt>0.0000</bed_amt>
    <ecess_amt>0.00</ecess_amt>
    <vattotal>0.0000</vattotal>
    <misc_charg>0.0000</misc_charg>
    <prevatcharges>0.0000</prevatcharges>
    <postvatcharges>0.00</postvatcharges>
    <packingAmt>0.00</packingAmt>
    <lstamt>14.00</lstamt>
    <w>
    <vatname>MVAT 5%</vatname>
    <syssrl>2</syssrl>
    <f>
    <glname>CONSUMABLE STORES</glname>
    </f>
    </w>
    </z>
    </y>
    </PurchaseRrgister>

    Hi Sushil Agarwal,
    As per my understanding, you want to create a matrix and use xml as data source for purchase bills, each purchase bill has multiple items with different rate and vat. In order to improve the efficiency of troubleshooting, I need to ask several questions:
    Please provide corresponding column name for purchase, rate, billtotal and vattotal.
    “but grand total of billtotal, vattotal gets added as many times as the items are there in that each bill” What’s the meaning of this sentence?
    What function do you want to achieve? What’s the state of report now? please provide some more detailed information of your requirements. I would be appreciated it if you could provide screenshot of the report in design mode.
    This may be a lot of information to ask for at one time. However, by collecting this information now, it will help us move more quickly toward a solution.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Grand total (Report footer) issue in a Report with Group selection.

    Hi,
    The case is simple, i have to summrise the NetValue field of a  report at the Group level and at the Report level(Grand Total).
    I also use a Group selection filter (I have grouped my records by MaterialDesc) to keep the desired groups.
    As you already guessed, my group totals are fine but the grand totals(report footer) contain both filtered and non filtered group records. Is there any way to avoid this problem and get a Grand Total from the filtered group records?
    Thank you.

    You can not use standard summaries with Group Suppression you must use either Running Totals or variables.
    In Running Total  evaluate click theformual button and eneter reverse condition to your group suppression.
    If you can not do that then you must use a Var
    In group footer where total is currently correct place a formula like this and suppress it
    @eval
    whileprintingrecords;
    global numbervar RepTot;
    If ..whatever your suppression condition is not true... then reptot:= reptot + sum( valuefield, groupfield);
    In report footer
    @display
    whileprintingrecords;
    global numbervar RepTot;
    Ian

  • Matrix Report with Fill Zero

    Hello ,
    I created a matrix report , Outer join is using in query ,so couldn't fill "0" to blank ammount column , please help me
    Query is :-
    SELECT
    nvl(AAMT,0) AAMT,
    nvl(AHRS,0) AHRS,
    JOBNUM JOBNO,
    B.USERCCM,
    B.CCMNAME
    FROM
    (SELECT SUM(ACTAMT) AAMT,
    SUM(ACTHRS) AHRS,
    JOBNUM,
    CCM,
    DEPTCODE FROM
    (SELECT SUM( ACTAMT) ACTAMT,
    SUM(ACTHRS) ACTHRS,
    JOBNUM,
    CCM,
    DEPTCODE
    FROM CSBUDTIM
    WHERE DEPTCODE=:DEPTCOD AND
    JOBNUM BETWEEN :JOBNUM AND :JOBNUM1 AND
    TRDATE BETWEEN :FROMDATE AND :TODATE
    GROUP BY JOBNUM,CCM,DEPTCODE
    UNION ALL
    SELECT SUM( ACTAMT) ACTAMT,
    SUM(ACTHRS) ACTHRS,
    JOBNUM,
    CCM,
    DEPTCODE
    FROM CSBUDETM
    WHERE DEPTCODE=:DEPTCOD AND
    JOBNUM BETWEEN :JOBNUM AND :JOBNUM1 AND
    TRDATE BETWEEN :FROMDATE AND :TODATE
    GROUP BY JOBNUM,CCM,DEPTCODE
    UNION ALL
    SELECT SUM(ACTAMT) ACTAMT,
    0 ACTHRS,
    JOBNUM,
    NVL(CCM,'DM') CCM,
    DEPTCODE
    FROM CSBUDMAT
    WHERE DEPTCODE=:DEPTCOD AND
    JOBNUM BETWEEN :JOBNUM AND :JOBNUM1 AND
    TRDATE BETWEEN :FROMDATE AND :TODATE
    GROUP BY JOBNUM,CCM,DEPTCODE)
    GROUP BY JOBNUM,CCM,DEPTCODE) A ,
    CSPGMCCM B
    WHERE B.DEPTCODE = A.DEPTCODE(+) AND
    B.USERCCM = A.CCM(+) and
    B.DEPTCODE = :DEPTCOD
    ORDER BY A.JOBNUM,B.USERCCM
    --------------------------------------------------------------------------------

    Hay Thahir,
    Can u plz tell me the solution

  • Use SSAS Tabular KPI in SSRS report with groups

    I have a SSAS tabular model that I have built KPIs in. I have tried several attempts to use the KPI in SSRS with multiple groups, but as you probably know when you aggregate the KPI it does not calculate correctly. How do you use SSAS KPIs with SSRS groups?
    Thanks in advance.

    Hi Micheal,
    According to your description, you want to use the KPI created in SSAS tabular for SSRS multiple groups. Right?
    In Analysis Services, when we create KPI, it works for each detail record. This KPI will not consider any aggregation value. So when you aggregate the KPI in SSRS, it can't return correct result. However, in Reporting Services, you can use Variable
    to define a "KPI" and apply condition with aggregation function(like sum, average) based on this "KPI" in Expression to return the correct result. Also you can use the Indicator in SSRS to achieve this requirement. Please refer to
    links below:
    Report and Group Variables Collections References (Report Builder and SSRS)
    Indicators (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Matrix report with Date

    Hi All,
    How do I generate a report with colum is data and row is date like below, and then generate a chart that show the progress by each day. Thanks so much for your help.
    Date 03/17/2006 03/18/2006 03/19/2006 03/20/2006 .........
    My Data
    Data 1 2 20 3 28
    Data 2 3 35 0 0
    Data 3 6 88 9 7
    Data 4 8 123 100 88
    Best Regards,
    Andy Pham

    Hi Andy,
    In a matrix report, the usual problem with reporting by all the dates in a period is that they may be gaps in dates where there is no data for that day.
    Therefore, you will need to have a workaround by having a view with all the possible dates using something like the following SQL.
    eg
    CREATE VIEW MY_VIEW AS
    SELECT (TRUNC(sysdate) -30 + ROWNUM) DATES FROM user_objects WHERE rownum < 31;
    You can play around with this SQL to suit your requirements.
    In your query for the matrix report, include MY_VIEW to the query and outer join your date column to DATES. ie DATES = your_date_column(+)
    Use DATES as a MATRIX column field and it will give you 30 columns. The MATRX row field and MATRIX cell field will be your own data.
    One very important thing to note is your date column must be truncated to 0 hours and minutes otherwise you will not get matching records.
    Regards,
    John

Maybe you are looking for

  • Struts Error while loading a page

    Hi Friends, In our aplication when i try to load a page am getting the following error , please throw some light if you have come across any such exception: <Error> <HTTP> <101017> <[ServletContext(id=22376268,name=QS,context-path=/QS)] Root cause of

  • Can I get the Requisition Submitted Date and Time in Emails

    Can I get the Requisition Submitted Date and Time in Emails Hi, Is there a way to get Requisition submitted Date and Time in Service Initiation Emails.

  • PPP CHAP re-authentication timer , detectable ?

    I think PPP with CHAP has an interval or periodic timer that triggers a re-authentication. I cannot find a timer setting to set the interval. Neither can i find a show command that will show me the timer. If this is a randomized timer, then it is cle

  • MacBook Pro with Retina display not transferring new songs.

    I have the 15" MacBook Pro with Retina display. When I plug my iPod classic (4th gen) into my MacBook, my iTunes does not display that it has been connected as it does with my iPhone. However, screen on my iPod shows that it is connected. Also, my ne

  • Ipod Touch 2.0.2 update problem

    ok so i just bought the 2.0.2 update when it started downloading, it said that my computer was full or something so i cound't get it in and now i have no idea how to get it back do i have to buy it again or something..