Order by cluse in matrix report

Hello Friends,
I have a month wise summary statment in matrix report formate, base on the following query
select to_char(pvmdate,'Mon-RRRR') as pvmdate, pvtamnt,pvtwhta,pvt.lv4code
I have use ORDER BY TO_DATE(PVMDATE,'Mon-RRRR') but this order by cluse give data in asending order by month i.e
Aug-2004,Dec-2004.... etc and i need data in proper yearlly order i.c Jan-2004,Feb-2004,Mar-2004

Order by month number instead of month name:
order by to_char(pvmdate,'mm')

Similar Messages

  • Product Order for Matrix Reports [Certification Question]

    [ My Situation ]
    I'm having difficulty understanding the use of a property: a cell's Product Order property, used in Matrix reports by the main cells. Basically, I can't figure out what it does.
    [ What I Think a Matrix Report Is ]
    I understand the matrix report concept like so:
    A matrix report consists of 3 basic components: A category Row, a category Column, and Cells.
    The Row is the result of a query such as "SELECT DISTINCT dept_no FROM emp".
    The Column is like the Row such as "SELECT DISTINCT gender FROM emp".
    A Cell is a summary that coresponds to the queries that formed the Row and the Column, such as:
    SELECT AVG(salary)
    FROM emp
    GROUP BY dept_no, gender
    HAVING dept_no = 10 AND gender = "Female";
    The example above would produce a report where you could see whether males and females tended to have different salaries for various departments.
    [ I Know How the Data Model Works ]
    I understand the Data Model for a matrix report, where the summary fields go, etc.
    [ What I Think Product Order Does ]
    I don't understand what Product Order does for the Cells of a matrix report. It's a list of combinations of the groups in the matrix group from the Data Model. I think it translates to the order of the columns in a query's ORDER BY clause.
    If I reverse the order in which the groups appear in Product Order, I get different results. If my understanding of a matrix report and the Product Order property is correct, the order shouldn't matter.
    What am I misunderstanding?
    Thanks in advance for your help.

    from the online help:
    Description The Product Order property is the order in which
    groups are evaluated in the cross product for a summary.
    Product Order also defines the frequency of a summary, formula,
    or placeholder in a cross product group. That is, the summary,
    formula, or placeholder has one value for each combination of
    values of the groups in its Product Order. Product Order is
    used only for columns owned by cross-product groups. Because a
    cross product relates multiple groups, the groups in the cross
    product could be evaluated in any one of many different orders.
    Therefore, when creating a summary for a cross product, you must
    use Product Order to specify for Report Builder which group
    should be evaluated first, which second, and so on. You must
    also use Product Order to specify the frequency of a summary,
    formula, or placeholder within the cross product.
    Values A valid group combination.
    Applies to summary, formula, and placeholder columns
    Required/Optional required, if the column is a summary or
    formula column belonging to a cross product group.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sort columns in matrix report

    Hi all
    I create matrix report( in version 9i)
    I want sort columns of report
    when i use order by it sort rows but i want sort columns
    my query is like this:
    SELECT
    Code,
    name,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E') Activity,
    SUM(amnt) amount
    From Mytable
    Where ....
    group by
    Code,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E')
    my group base on code
    my columns base on Activity
    and cells are Amount
    my report result is:
    ........ B E D A C
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    I want this :
    ........ A B C D E
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    ....

    Hello,
    How about this?
    SELECT Code, name,
    DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
    From Mytable
    WHERE ....
    GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
    ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')

  • Matrix Report 's Query Output is not as Toad...!!!!!!

    Hello,
    i have the following Query
    SELECT ALL
    FINANCIAL_YEAR_MONTHS.month_desc||' '|| substr( FINANCIAL_YEAR_MONTHS.month_code,4,4)  months,
    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE,
    CDE_MATERIALS.MATERIAL_DESC, CDE_MATERIALS.PARENT_MATERIAL,
    PLN_PLAN_DISTRIBUTION_WAY.EXPECTED_QUANTITY,
    PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE,
    PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE
    FROM
    PLN_PLAN_DISTRIBUTION_WAY,
    PLN_PLAN_PRODUCTS,
    CDE_MATERIALS,
    FINANCIAL_YEAR_MONTHS
    WHERE
    (PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = PLN_PLAN_PRODUCTS.MATERIAL_CODE)
    AND (    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = CDE_MATERIALS.MATERIAL_CODE   )
    AND (PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE = PLN_PLAN_PRODUCTS.GROUP_CODE)
    AND ( PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE= PLN_PLAN_PRODUCTS.FIN_YEAR_CODE )
    AND (  PLN_PLAN_DISTRIBUTION_WAY.MONTH_CODE = 
    to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2)))
    AND( to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2)) >= 7 )
    AND (PLN_PLAN_DISTRIBUTION_WAY.DISTRIBUTION_WAY = :P_DISTRIBUTION_WAY )
    AND (PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE = :P_FIN_YEAR_CODE)
    UNION ALL
    SELECT ALL
    FINANCIAL_YEAR_MONTHS.month_desc||' '|| substr( FINANCIAL_YEAR_MONTHS.month_code,4,4)  months,
    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE,
    CDE_MATERIALS.MATERIAL_DESC, CDE_MATERIALS.PARENT_MATERIAL,
    PLN_PLAN_DISTRIBUTION_WAY.EXPECTED_QUANTITY,
    PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE,
    PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE
    FROM
    PLN_PLAN_DISTRIBUTION_WAY,
    PLN_PLAN_PRODUCTS,
    CDE_MATERIALS,
    FINANCIAL_YEAR_MONTHS
    WHERE
    (PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = PLN_PLAN_PRODUCTS.MATERIAL_CODE)
    AND (    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = CDE_MATERIALS.MATERIAL_CODE   )
    AND (PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE = PLN_PLAN_PRODUCTS.GROUP_CODE)
    AND ( PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE= PLN_PLAN_PRODUCTS.FIN_YEAR_CODE )
    AND (  PLN_PLAN_DISTRIBUTION_WAY.MONTH_CODE = 
    to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2)))
    AND to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2))<= 6 
    AND (PLN_PLAN_DISTRIBUTION_WAY.DISTRIBUTION_WAY = :P_DISTRIBUTION_WAY )
    AND (PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE = :P_FIN_YEAR_CODE) the Report is a Matrix Report with Group Material_names as Rows and financial Months as Columns and the expected_Quantity as cells of that report matrix.
    Well,the query runs just fine in Toad as
    Months Material_code Material_Desc ..etc.
    July 2007 1 abc
    July 2007 2 def ...etc.
    June 2008 1 abc ..etc.
    June 2008 2 def ...etc.
    But in a report the output of months are a mess not ordered as a fin_year months..
    i tried to change the design of the report from Matrix group to Matrix got same result...
    Any Suggestions pls.
    Regards,
    Abdetu..

    This the Query with order by which doesn't return the required order..
    SELECT ALL
    FINANCIAL_YEAR_MONTHS.month_desc||' '|| substr( FINANCIAL_YEAR_MONTHS.month_code,4,4)  months,
    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE,
    CDE_MATERIALS.MATERIAL_DESC, CDE_MATERIALS.PARENT_MATERIAL,
    PLN_PLAN_DISTRIBUTION_WAY.EXPECTED_QUANTITY,
    PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE,
    PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE
    FROM
    PLN_PLAN_DISTRIBUTION_WAY,
    PLN_PLAN_PRODUCTS,
    CDE_MATERIALS,
    FINANCIAL_YEAR_MONTHS
    WHERE
    (PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = PLN_PLAN_PRODUCTS.MATERIAL_CODE)
    AND (    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = CDE_MATERIALS.MATERIAL_CODE   )
    AND (PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE = PLN_PLAN_PRODUCTS.GROUP_CODE)
    AND ( PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE= PLN_PLAN_PRODUCTS.FIN_YEAR_CODE )
    AND (  PLN_PLAN_DISTRIBUTION_WAY.MONTH_CODE = 
    to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2)))
    AND( to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2)) >= 7 )
    AND (PLN_PLAN_DISTRIBUTION_WAY.DISTRIBUTION_WAY = :P_DISTRIBUTION_WAY )
    AND (PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE = :P_FIN_YEAR_CODE)
    UNION ALL
    SELECT ALL
    FINANCIAL_YEAR_MONTHS.month_desc||' '|| substr( FINANCIAL_YEAR_MONTHS.month_code,4,4)  months,
    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE,
    CDE_MATERIALS.MATERIAL_DESC, CDE_MATERIALS.PARENT_MATERIAL,
    PLN_PLAN_DISTRIBUTION_WAY.EXPECTED_QUANTITY,
    PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE,
    PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE
    FROM
    PLN_PLAN_DISTRIBUTION_WAY,
    PLN_PLAN_PRODUCTS,
    CDE_MATERIALS,
    FINANCIAL_YEAR_MONTHS
    WHERE
    (PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = PLN_PLAN_PRODUCTS.MATERIAL_CODE)
    AND (    PLN_PLAN_DISTRIBUTION_WAY.MATERIAL_CODE = CDE_MATERIALS.MATERIAL_CODE   )
    AND (PLN_PLAN_DISTRIBUTION_WAY.GROUP_CODE = PLN_PLAN_PRODUCTS.GROUP_CODE)
    AND ( PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE= PLN_PLAN_PRODUCTS.FIN_YEAR_CODE )
    AND (  PLN_PLAN_DISTRIBUTION_WAY.MONTH_CODE = 
    to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2)))
    AND to_number(substr( FINANCIAL_YEAR_MONTHS.month_code,1,2))<= 6 
    AND (PLN_PLAN_DISTRIBUTION_WAY.DISTRIBUTION_WAY = :P_DISTRIBUTION_WAY )
    AND (PLN_PLAN_DISTRIBUTION_WAY.FIN_YEAR_CODE = :P_FIN_YEAR_CODE)
    ORDER BY months

  • 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

  • Page break in Matrix report

    Hello Experts,
    I am trying to create a custom purchase order that shows shipping distributions.
    I have been successful so far in creating a matrix report that shows this. However, the client's requirement is that I limit the items to at least 10 items per page.
    I need to be able to create a page break to have 10 items per page and to have the header be included in the next page since the header includes the branches where the goods are supposed to be distributed.
    I have tried several things but I was not able to make it work.
    I can provide the xml and the rtf template if needed. Thank you.

    Hi Bifacts,
    Just sent the xml and rtf files your way. I appreciate any feedback you can give as I've been stuck on this for a while now.
    If anyone else can help out, it will be greatly appreciated!

  • How to create a matrix report on Apex 4.1

    Hi all.
    I need to create a report similar to this one:
    Jan Feb Mar .....
    Product Category
    Category One 999 999 999
    Category Two 999 999 999
    On a reporting tool like Oracle Reports, this is call a matrix report which can be easily created: just one simple query , select a matrix report type, compute summary values for row /column and grand total, and that is.
    How would one implement this on Apex 4.1???
    Have a couple of ideas:
    - Populate temporary table with columns corresponding to month.
    - Create a procedure that return a collection and use that as a source for report.
    - Etc.
    What other options do i have ...?
    Thanks in advance ...!

    Hi all,
    I did create a matrix report using the pivot function and some interesting settings in APEX. So far it is only does display data. I did not find a way yet(?) to alter the data in the same matrix.
    The data is based on a simple set of tables about planning. The end result does look something like the matrix below. Note: the dashes are just there to make the matrix look like a matrix on this forum.
    Resource 13-08 20-08 27-08 03-09 10-09 17-09 24-09
    Angelo-----25-----22-----12-----10------------------------
    John---------8-----22-----36-----22------------------------
    Marit-----------------5-----40-----36-----24-----12-----10
    The resources (Angelo, John and Marit) are being registered in the following table:
    CREATE TABLE EVP_RESOURCES
    RSS_ID NUMBER(10,0) NOT NULL,
    NAME VARCHAR2(25 BYTE) NOT NULL
    The date periods (13-08 till 24-09) are being registered in the next table:
    CREATE TABLE EVP_DATA_POINTS
    DPT_ID NUMBER(10,0) NOT NULL,
    DATA_POINT_DATE DATE NOT NULL,
    V_DATA_POINT_DATE_FORMATED VARCHAR2(75 BYTE) GENERATED ALWAYS AS (TO_CHAR("DATA_POINT_DATE",'dd-mm')) VIRTUAL VISIBLE
    The virtual column (v_data_point_date_formated) is not needed. You can use this virtual column or format the column in multiple places.
    The available units are being registered in the intersection table below:
    CREATE TABLE EVP_RESOURCE_PLANNING
    RPG_ID NUMBER(10,0) NOT NULL,
    DPT_ID NUMBER(10,0) NOT NULL,
    RSS_ID NUMBER(10,0) NOT NULL,
    UNITS NUMBER(10,0)
    The data is being displayed in APEX in a report region of type "SQL Query (PL/SQL function body returning SQL query)". And the following option has to be switched on "Use Generic Column Names (parse query at runtime only)".
    This does give a restriction on the number of columns which can be used. You can however change the number of columns in the field "Maximum number of generic report columns:" to a high number. So in most cases this is no issue at all.
    In the Region Source I did put the following code:
    begin
    return 'select *
    from ( select rss.name "Resource"
    , v_data_point_date_formated
    , rpg.units
    from evp_resources rss
    , evp_data_points dpt
    , evp_resource_planning rpg
    where rpg.dpt_id = dpt.dpt_id
    and rpg.rss_id = rss.rss_id
    pivot (sum(units) for v_data_point_date_formated in (' ||
    evp_pkg_dpm.f_dynamic_pivot_in ||
    order by 1';
    end;
    The function evp_pkg_dpm.f_dynamic_pivot_in does return a string which is based on the number of rows in the table evp_data_points. In my case this string is: '13-08' as "13-08",'20-08' as "20-08",'27-08' as "27-08",'03-09' as "03-09",'10-09' as "10-09",'17-09' as "17-09",'24-09' as "24-09". If you ommit the 'as "..."' you do get quotes in your headings.
    Enjoy and regards,
    Jurgen
    PS: let me know if something is missing or not clear!
    Edited by: user553427 on Aug 17, 2012 5:46 AM (Query has been made more simple and I build up the header differently)

  • SSRS Expression to calculate percentage with the denominator being the first value in the same column group in a matrix report

    Hello, Expert,
    Could you please help me with the following problem? Thanks in advance!
    I have designed the matrix report (SSRS 2012) with database table structure looks like below.    
    Week           
    Version
         Count
    Week1
    V1.1
    4000
    Week1
    V1.2
    4000
    Week1
    V1.3
    4000
    Week2
    V1.1
    3000
    Week2
    V1.2
    3000
    Week2
    V1.3
    3000
    Week3
    V1.1
    2000
    Week3
    V1.2
    2000
    Week3
    V1.3
    2000
    Week4
    V1.1
    1000
    Week4
    V1.2
    1000
    Week4
    V1.3
    1000
    The matrix report displays like below. Column grows based on no of Week in the table.   
    Week1
    Week2
    Week3
    Week4
    V1.1
    4000
    3000
    2000
    1000
    V1.2
    4000
    3000
    2000
    1000
    V1.3
    4000
    3000
    2000
    1000
    What I want to do now is: instead of the Count values, I need to calculate the percentage of each week over the
    Count in Week1 so that each cell displays Count(Week2)/Count(Week1), Count(Week3)/Count(Week1), etc. What is the SSRS expression for that? I’m new to SSRS, Please help!

    Heidi,
    Thank you so much for your reply and solution! Now I know how to get the first field in a group. But I can't apply your solution directly just yet because in order to explain my problem I simplified my data structure. My real data structure has a nested
    group like this:
    Week  VersionMajor VersionMinor Count
    Week1  V1           V1.1         2000
    Week2  V1           V1.1         1500
    Week3  V1           V1.1         800
    Week1  V1           V1.2         1000
    Week2  V1           V1.2         500
    Week3  V1           V1.2         200
    Week1  V1           V1.1         2000
    Week2  V1           V1.1         1500
    Week3  V1           V1.1         800
    Week1  V1           V1.2         1000
    Week2  V1           V1.2         500
    Week3  V1           V1.2         200
    Here is the query for the above data:
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
    And my matrix table looks like this:
    What I need to do is to calculate the percentage of each week over week1 for
    1) V1 Total
    2) V1.1
    3) V1.2
    I can't use your solution directly because I need to apply Sum function for each cell and the Sum function gives me error when I try to use it on the denominator
    First(Fields!Count.Value,"VersionMinor"). If you could help me further to get to the final solution, I'd really appreciate it!!
    Happy New Year!

  • Need help in matrix report

    <p>Dear fellows,<br>
    <br>
    I am designing a matrix report of Rooms those are vacant at certian time and
    days of week. In this time values are fixed, I have written the mention below
    query to design the report.<br>
    <b><br>
    Table Description is</b> <br>
    <br>
    <br>
    SQL> desc vac_rm<br>
    Name                            
    Null?     Type<br>
    ----------------------------------------- -------- ----------------------------<br>
    RM_NO                                           
        NOT NULL VARCHAR2(8)<br>
    DAY                                                     
    NOT NULL VARCHAR2(9)<br>
    TIME                                                    
    NOT NULL VARCHAR2(20)<br>
    VACANT                                                                  
    CHAR(1)<br>
    <br>
    <b>Query is</b> <br>
    SELECT day, time,<br>
    LTRIM(MAX(SYS_CONNECT_BY_PATH(rm_no,','))<br>
    KEEP (DENSE_RANK LAST ORDER BY curr),',') AS Room<br>
    FROM (SELECT day,time, rm_no,<br>
    ROW_NUMBER() OVER (PARTITION BY day ORDER BY rm_no) AS curr,<br>
    ROW_NUMBER() OVER (PARTITION BY day ORDER BY rm_no) -1 AS prev<br>
    FROM vac_rm <br>
    where vacant = 'Y'))<br>
    GROUP BY day, time<br>
    CONNECT BY prev = PRIOR curr AND day = PRIOR day<br>
    START WITH curr = 1<br>
    <br>
    The problem occur in this way that when I see the result It show same room no
    many time in single cell.<br>
    <br>
    For Example there is Room A1 and it is vacant on monday at <br>
    9:00 AM - 11:00 AM, then it will show<br>
    <br>
    <b>Time</b>            9:00 AM - 11:00
    AM    11:15 AM - 1:00 PM<br>
    <b>Day</b> <b><br>
    Moday</b>            
    A1, A1, A1                A1, A1, A1, A3, A2<br>
    <br>
    I am very grateful In this regard if you sort out this matter. <br>
     </p>

    For the periods, create a seperate dummy query and then use it as column group in the multi query matrix.

  • Display null rows / columns in matrix report

    Hi,
    Is it possible to display any character ('0' for example) in a matrix report where the entire row or column show no value at all ?
    My matrix shows Row1 and Row2 with values but no Row3 at all like this:
    Column1 Column2 Column3
    Row1 value1 value2 value3
    Row2 value4 value5 value6
    But I would like it to show my rows 3 with '0's :
    Column1 Column2 Column3
    Row1 value1 value2 value3
    Row2 value4 value5 value6
    Row3 0 0 0
    Thank you,
    Denise

    Make your query return 0 with nvl(column, 0) and an outer join, plus some stuff to avoid a double outer join.
    E.g. a sales per product per city:
          City1   City2  City3
    Prod1   10     100    12
    Prod2   25     110   200
    Prod3    0       0     0Could be made like this:
    create table city (c_city  varchar2(10));
    create table prod (p_prod   varchar2(10));
    create table prod_sales (ps_city varchar2(10)
    , ps_prod varchar2(10)
    , ps_sales number);
    <.....insert some values, except voor Prod3 .....>
    SQL> select p_prod, c_city, nvl(ps_sales,0)
      2  from (select c_city, p_prod from city, prod)
      3  ,    prod_sales
      4  where ps_city(+) = c_city
      5  and   ps_prod(+) = p_prod
      6  order by 1,2 ;
    P_PROD     C_CITY     NVL(PS_SALES,0)
    Prod1      City1                   10
    Prod1      City2                  100
    Prod1      City3                   12
    Prod2      City1                   25
    Prod2      City2                  110
    Prod2      City3                  200
    Prod3      City1                    0
    Prod3      City2                    0
    Prod3      City3                    0

  • 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

  • Need Help : Matrix Report

    Hi Everyone,
    I Followed the steps in the link [http://docs.oracle.com/html/B13895_01/orbr_matrix.htm] to create a matrix report, In the above link they used only one table EMP to create the matrix report, but my requirment is based on two table i have to create this matrix report.
    This is my sample code,
    SELECT e.DEPTNO, e.JOB, SUM(SAL),d.loc
    FROM EMP e,dept d
    where e.DEPTNO = d.DEPTNO(+)
    GROUP BY e.DEPTNO, e.JOB,d.loc
    ORDER BY e.DEPTNO, e.JOBand i need layout like below
    ---------------------------------------------ANALYST---------CLERK---------MANAGER---------PRESIDENT---------SALESMEN---------LOCATION---------
    ---------10------------------------------------0.00------------1300.00---------2450.00------------5000.00--------------0.00--------------NEWYORK---------
    ---------20-------------------------------6000.00------------1900.00---------2975.00-----------------0.00--------------0.00--------------DALLAS-------------
    ---------30------------------------------------0.00--------------950.00---------2850.00----------------0.00----------5600.00--------------CHICAGO-----------
    Can anyone help me in this,
    Brgds,
    SriG

    Dear ,
    In Matrix Report , There are 2 or more then 2 Repeating frames , As report in going out of page u may have to set the Left to Right Repeating Frame
    Sajid

  • Formula Column in Matrix Report (Running Balance)

    Hi all. I hope somebody can help me.
    I am working on a matrix report using multi-query data models. The report has 2 groups in the horizontal axis and 3 groups in the vertical axis. The intersection is not just a single row but may consist of multiple rows.
    My problem is this. I want to create a column in the intersection which is obtained by using a column value from the lowest group in the vertical axis and a summary column obtained from the rows of the intersection.
    Here's what my report looks like:
    2002 (accross)
    2002(down) january february (accross)
    January (down) payments balance payments balance
    loan #1 10,000 500 9,000 200 8,800
    500
    loan #2 5,000 100 4,900 200 4,700
    February
    loan #3 3,500 0 3,500 50 3,450
    loan #4 4,200 0 4,200 0 4,200
    As you can see, the loans are grouped by month and year. And the payments are grouped for the month and year too.
    The data model is :
    For Query 1 (Vertical Axis),
    1st group - Loan Yr
    2nd group - Loan Mo
    3rd group - Loan # and amount
    For Query 2 (Horizontal Axis)
    1st group - Payment Yr
    2nd group - Payment Mo
    Intersection Group - Payment Amount
    My problem actually is how to compute for the running balance of the loan for each month in the horizontal axis. Ive already created a cross product summary to get the running total of the payments made for the month. I tried creating a formula column to for the running balance by subtracting it from the loan amount but i get the error "incompatible frequency"
    I hope i have described my problem well and thanks for the help

    The problem is that you're trying to reference dimension columns(loan Amount) in the calculation of matrix cell values. You can only reference other matrix cell values or cross product columns (summary, formula, placeholders) when calculating matrix cell values. Try moving the (loan Amount) column down to the matrix cell - something like:
    For Query 1 (Vertical Axis),
    1st group - G_LoanYear(LoanYr)
    2nd group - G_LoanMonth(LoanMo)
    3rd group - G_LoanNumber(Loan#)
    For Query 2 (Horizontal Axis)
    1st group - G_PaymentYear(PaymentYr)
    2nd group - G_PaymentMonth(PaymentMo)
    Intersecion /Detail Group - G_Details(PaymentAmount, LoanAmount)
    Then create the following Matrix summary columns:
    A running summary - CS_Payments:
    - Product Order: G_LoanYear G_LoanMonth G_LoanNumber G_PaymentYear G_PaymentMonth
    - Source: PaymentAmount
    - Function: Sum
    - Reset At: G_LoanNumber
    The total amount per loan - CS_TotalPayment:
    - Product Order: G_LoanYear G_LoanMonth G_LoanNumber
    - Source: LoanAmount
    - Function: First
    - Reset At: G_LoanNumber
    The value of the loan after each payment - CF_Countdown:
    - Product Order: G_LoanYear G_LoanMonth G_LoanNumber G_PaymentYear G_PaymentMonth
    - PL/SQL Formula:
    function CF_CountdownFormula return Number is
    begin
    return(:CS_TotalPayment - :CS_Payments);
    end;
    You should then be able to display "CF_Payments" and "CF_Countdown" in the matrix cell to show how much has been paid and how much is still owed.
    You can still have another "loan amount" as a dimension column - you just don't need to use it when calculating the values in the cell.

  • Formula Columnn in Matrix Report (Running Balance)

    Hi all. I hope somebody can help me.
    I am working on a matrix report using multi-query data models. The report has 2 groups in the horizontal axis and 3 groups in the vertical axis. The intersection is not just a single row but may consist of multiple rows.
    My problem is this. I want to create a column in the intersection which is obtained by using a column value from the lowest group in the vertical axis and a summary column obtained from the rows of the intersection.
    Here's what my report looks like:
                        2002 (accross)                         2003
                        januar                    february (accross
                        payments      balance          paymenst     balance
    2002 (down)
    Januar (down)          
         Loan#1 10,000 500          9000          200          8800          
                   500
         Loan#2     5000     100          4900          200          4700
    February
         Loan#3     3500     0          3500          50          3450
         Loan#4     4200     0          4200          0          4200
    As you can see, the loans are grouped by month and year. And the payments are grouped for the month and year too.
    The data model is :
    For Query 1 (Vertical Axis),
    1st group - Loan Yr
    2nd group - Loan Mo
    3rd group - Loan # and amount
    For Query 2 (Horizontal Axis)
    1st group - Payment Yr
    2nd group - Payment Mo
    Intersecion /Detail Group - Payment Amount
    My problem actually is how to compute for the running balance of the loan for each month in the horizontal axis. Ive already created a cross product summary to get the running total of the payments made for the month. I tried creating a formula column to for the running balance by subtracting it from the loan amount but i get the error "incompatible frequency"
    I hope i have described my problem well and thanks for the help

    The problem is that you're trying to reference dimension columns(loan Amount) in the calculation of matrix cell values. You can only reference other matrix cell values or cross product columns (summary, formula, placeholders) when calculating matrix cell values. Try moving the (loan Amount) column down to the matrix cell - something like:
    For Query 1 (Vertical Axis),
    1st group - G_LoanYear(LoanYr)
    2nd group - G_LoanMonth(LoanMo)
    3rd group - G_LoanNumber(Loan#)
    For Query 2 (Horizontal Axis)
    1st group - G_PaymentYear(PaymentYr)
    2nd group - G_PaymentMonth(PaymentMo)
    Intersecion /Detail Group - G_Details(PaymentAmount, LoanAmount)
    Then create the following Matrix summary columns:
    A running summary - CS_Payments:
    - Product Order: G_LoanYear G_LoanMonth G_LoanNumber G_PaymentYear G_PaymentMonth
    - Source: PaymentAmount
    - Function: Sum
    - Reset At: G_LoanNumber
    The total amount per loan - CS_TotalPayment:
    - Product Order: G_LoanYear G_LoanMonth G_LoanNumber
    - Source: LoanAmount
    - Function: First
    - Reset At: G_LoanNumber
    The value of the loan after each payment - CF_Countdown:
    - Product Order: G_LoanYear G_LoanMonth G_LoanNumber G_PaymentYear G_PaymentMonth
    - PL/SQL Formula:
    function CF_CountdownFormula return Number is
    begin
    return(:CS_TotalPayment - :CS_Payments);
    end;
    You should then be able to display "CF_Payments" and "CF_Countdown" in the matrix cell to show how much has been paid and how much is still owed.
    You can still have another "loan amount" as a dimension column - you just don't need to use it when calculating the values in the cell.

  • Matrix report with row field as "dates of months"

    Hi all,
    I have a matrix report that requires such a format:
    Some database column -->
    1 cell cell cell cell
    2 null null null null
    3
    4
    31 cell
    now i cannot get the dates of the month in order of 1 to 31'st as column, if i give my database column datefield the records which are on following date are displayed but for the dates which dont have records, the cell fields should be null..
    How would i do this.
    Regards,
    Sreekanth.

    Hi all,
    I have a matrix report that requires such a format:
    Some database column -->
    1 cell cell cell cell
    2 null null null null
    3
    4
    31 cell
    now i cannot get the dates of the month in order of 1 to 31'st as column, if i give my database column datefield the records which are on following date are displayed but for the dates which dont have records, the cell fields should be null..
    How would i do this.
    Regards,
    Sreekanth.

Maybe you are looking for

  • Mapping - Questions

    Hi,    I have few basic questions regarding mappings.    1)  I think we can do everything by using Graphical Mapping. Then what is the purpose for Java, XSLT and ABAP mapping? Please give me an example for this...    2) Which mapping will give better

  • Solaris8: Problem installing on a SCSI System

    I have this hardware: Pentium 200 MMX, 128MB, Tekram 390F PCI SCSI Controller, 2 SCSI UW harddisks, 2 cdrom, zip-drive, (all SCSI !),... With Solaris 8 I encounter the following installation problem: I tried several times to install Solaris 8 on the

  • Usage of external LDAP server with Portal

    Hi All, We are in a situation to use external LDAP server with WLP 8.1. These are the constraints we have to deal with: 1. Only read is allowed from this LDAP server. 2. This would be used for authentication purpose If thats the case, how can we use

  • How to use Solve Order in Dimension level formula

    Hi All, Can anyone explain me how to use "Solve order" in formulas defined in dimension? Regards, Kapil

  • Unusual eMail Question: import raw message content...

    I get over 100 email alerts each week that are important to my business that contain about 12 data points that pertain to certain event activity. The up-side is these messages are in the exact same format and content so there is little variation, in