Pivot table in BI Publisher: Different aggregate functions in data columns

Hi, everyone!
I`ve got some troubles with pivot table in my rtf-template.
Here is my xml:
<ROWSET>
     <ROW>
          <_BI_SUBRF_MO_._MUN_NAME_>МО Петроградский р-н</_BI_SUBRF_MO_._MUN_NAME_>
          <_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>714000003</_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>
          <_BI_MONTH_DEBET_._BI_DEBET_SUM_>0.0</_BI_MONTH_DEBET_._BI_DEBET_SUM_>
          <_BI_CALENDAR_._YEAR__>2009</_BI_CALENDAR_._YEAR__>
          <_BI_CALENDAR_._MONTH__>8</_BI_CALENDAR_._MONTH__>
     </ROW>
     <ROW>
          <_BI_SUBRF_MO_._MUN_NAME_>МО Петроградский р-н</_BI_SUBRF_MO_._MUN_NAME_>
          <_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>714000004</_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>
          <_BI_MONTH_DEBET_._BI_DEBET_SUM_>165.58</_BI_MONTH_DEBET_._BI_DEBET_SUM_>
          <_BI_CALENDAR_._YEAR__>2009</_BI_CALENDAR_._YEAR__>
          <_BI_CALENDAR_._MONTH__>7</_BI_CALENDAR_._MONTH__>
     </ROW>
     <ROW>
          <_BI_SUBRF_MO_._MUN_NAME_>МО Петроградский р-н</_BI_SUBRF_MO_._MUN_NAME_>
          <_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>714000004</_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>
          <_BI_MONTH_DEBET_._BI_DEBET_SUM_>165.58</_BI_MONTH_DEBET_._BI_DEBET_SUM_>
          <_BI_CALENDAR_._YEAR__>2009</_BI_CALENDAR_._YEAR__>
          <_BI_CALENDAR_._MONTH__>7</_BI_CALENDAR_._MONTH__>
     </ROW>
...... and so on..
</ROWSET>
In the pivot table i`d like to see one row for every BISUBRF_MO_._MUN_NAME_ using BICALENDAR_._YEAR__ and BICALENDAR_._MONTH__ as measures and sum of BIMONTH_DEBET_._BI_DEBET_SUM_ and count of unique (or at least just count of) BIPERS_ACCOUNT_CARD_._BI_PAC_NMB_ in cells.
I create a pivot table using wizard, everything ok except one thing: as i understand, in pivot table for data in rows we can use only one kind of aggregate function e.g. only sum or only count.
Is there any way to use different aggregate functions in data cells?
Thank you

As you can see, when we use crosstab tag we can specify only one aggregate function for data cells.
Is there any way to get in XSL-FO (where we can what really happens) instead of:
<T1>
<xsl:value-of select="sum(current-group()/_BI_PERS_ACCOUNT_CARD_._BI_PAC_UNID_)"/>
</T1>
<T2>
<xsl:value-of select="sum(current-group()/_BI_MONTH_DEBET_._BI_DEBET_SUM_)"/>
</T2>
this
<T1>
<xsl:value-of select="sum(current-group()/_BI_PERS_ACCOUNT_CARD_._BI_PAC_UNID_)"/>
</T1>
<T2>
<xsl:value-of select="count(current-group()/_BI_MONTH_DEBET_._BI_DEBET_SUM_)"/>
</T2>
Edited by: user12115038 on 26.10.2009 8:08

Similar Messages

  • Pivot Table in BI Publisher

    Hi All,
    I have a complex requirement, i.e, i have to build a template which gives a output like below
    Backlog by Type
    For SEP-13 Period End
    DESCRIPTION
    INTERNAL BACKLOG
    EXTERNAL BACKLOG
    CONTRACT TYPE
         COST PLUS FEE
    $408,708.09
    1.31%
    $5,925,211.60
    18.92%
         EXPENSE REIMBURSABLE
    $25.32
    0.00%
    $241,734.60
    0.77%
         FIXED PRICE
    $2,372,920.68
    7.58%
    $9,757,969.66
    31.16%
         INTERCOMPANY
    ($5,478.92)
    -0.02%
    ($5,478.92)
    -0.02%
         TIME AND MATERIAL
    $166,813.10
    0.53%
    $7,564,752.06
    24.16%
         TIME AND MATERIAL (CAP)
    $51,565.74
    0.16%
    $7,968,803.37
    25.45%
         WAR
    ($18,003.01)
    -0.06%
    ($18,003.80)
    -0.06%
    TOTAL
    $2,976,551.00
    $31,434,988.57
    CLIENT  TYPE
          FEDERAL           DOD$0.00  $3,531.86 
            AIR NATIONAL GUARD
    $0.00
    $181.85
            DELAWARE NATIONAL GUARD
    $0.00
    $3,350.01
       Total Federal
    $0.00
    0.00%
    $3,531.86
    0.01%
         NON FEDERAL 
             INTERCOMPANY
    $2,976,551.00
    $2,901,737.44
             ADESA INC
    $58,367.61
    $47,015.37
             AIR NATIONAL GUARD
    $68,216.83
    $64,047.28
             AMAZON.COM
    $300.63
    $300.63
    Total Non Federal
    $2,976,551.00
    9.50%
    $31,431,456.71
    100.37%
    TOTAL
    $2,976,551.00
    $31,434,988.57
    SERVICE TYPE
        Contract Management
    $0.00
    0.00%
    $8,483.60
    0.03%
        Engineering and Architectural Design
    $245,722.42
    0.78%
    $27,512,272.79
    87.85%
        Intercompany
    $2,730,828.58
    8.72%
    $2,701,708.70
    8.63%
        Management Consulting
    $0.00
    0.00%
    $37,299.50
    0.12%
        Research and Development
    $0.00
    0.00%
    $1,175,223.98
    3.75%
    TOTAL
    $2,976,551.00
    $31,434,988.57
    ****** End of Report ******
    The project type is classified into Internal and external.
    First --> I need to classify the data based on contract type and have to display the total internal and external backlog, this is based on the project type..I am able to achieve this using pivot table
    but my problem is in the same report i need to have the data which is then classified based on client type, within client type i need to classified based on federal and non federal.
    third-->I need the data to be classified based on the service type.  and in all three sections based on project type need to show the backlog .
    all this in the same report output.
    any help on this is greatly appreciated.
    Thanks.

    As you can see, when we use crosstab tag we can specify only one aggregate function for data cells.
    Is there any way to get in XSL-FO (where we can what really happens) instead of:
    <T1>
    <xsl:value-of select="sum(current-group()/_BI_PERS_ACCOUNT_CARD_._BI_PAC_UNID_)"/>
    </T1>
    <T2>
    <xsl:value-of select="sum(current-group()/_BI_MONTH_DEBET_._BI_DEBET_SUM_)"/>
    </T2>
    this
    <T1>
    <xsl:value-of select="sum(current-group()/_BI_PERS_ACCOUNT_CARD_._BI_PAC_UNID_)"/>
    </T1>
    <T2>
    <xsl:value-of select="count(current-group()/_BI_MONTH_DEBET_._BI_DEBET_SUM_)"/>
    </T2>
    Edited by: user12115038 on 26.10.2009 8:08

  • Pivot Tables in BI Publisher

    When including multiple Criteria in the "Rows" section of Pivot Table we get a desired format of Pivot Table in BI Analytics Answers. However, when creating a Pivot Table in a BI Publisher Template, Adding multiple measures in "Rows" results in the creation of duplicate rows.
    For example, the desired format is as follows:
    https://docs.google.com/spreadsheet/ccc?key=0AisK8m4TPhzKdDMzeDhfUjBZNTF5NWhleEEtX3piLXc&hl=en_US#gid=0
    this appears in BI Analytics Answers.
    However, when this table is made in BI Publisher Template, the format is as follows:
    https://docs.google.com/spreadsheet/ccc?key=0AisK8m4TPhzKdFlDQjBGU0NORWltNXp3STE1WTJZUVE&hl=en_US#gid=0
    Please help on how to obtain a pivot table in BI Publisher in the desired format.
    Regards

    While making Pivot Tables in RTF, make the rows "inline" rather than "outline".

  • Add additional DESC column at right side of pivot table in bi publisher

    ARABIC DESC
    India
    UAE
    Total
    English DESC
    QUANT_DECIMAL
    VALUE_DHS
    QUANT_DECIMAL
    VALUE_DHS
    QUANT_DECIMAL
    VALUE_DHS
    0
    0
    0
    0
    0
    0
    اجر
    4
    4
    23
    5619
    27
    5623
    ABC
    اجر
    0
    0
    10
    3510
    10
    3510
    CDF
    ملابس
    0
    0
    14
    772
    14
    772
    XYX
    جالية
    0
    0
    25
    2020
    25
    2020
    EJB
    Total
    4
    4
    72
    11921
    76
    11925
    please help me to add another column at right side of pivot table as marked in blue.
    1st column indicates in arabic desc and my client want english desc at right side of pivot table
    country is group by as INdia and UAE.
    Please help me to display the above report in pivot table in BI Publisher;
    Thanks
    Naveen

    Naveen,
    Do you have that column in the database?
    Thanks,
    Sasi Nagireddy..

  • Disabling auto sort of rows for Pivot Tables in BI Publisher

    is there a way to avoid the Pivot table in BI Publisher from sorting your data and just display the rows in the order retured from the data model ? By default it is sorting the data in asc order. Thanks !

    hi jim
    if you carefully look inside the form field's you will find the logic of sort . if you remove that you will get the data without any sorting order.
    else send me your template and xml to my email id i can look into that .
    email : [email protected]

  • How to use aggregate function with Date

    Hi All,
    I have a group of date from that is it possible to Max and Min of date.
    I have tried like this but its errored out <?MIN (current-group()/CREATION_DATE)?>.
    I have also tried like this but it doesnt works
    <?xdoxslt:minimum(CREATION_DATE)?>
    Is it possible to use aggregate function with date values.
    Thanks & Regards
    Srikkanth

    Hi KAVI PRIYA,
    if date is not in cannonical format, how can we change it in BI publisher, then how to calcualte minimum and as well as maximum.
    please advise me,
    Thanks,
    Sri

  • Understanding code behind Pivot tables in BI Publisher

    Hi All ,
    Is there any pointer which will help me to understand the code involved in Pivot table or crosstab.I went through the XML publisher user guide and it helped me to understand a bit.But the coding behind the pivot tables generated by the BI Publisher Desktop is completely different and especially the very first line e.g (<?crosstab:c594;"//r";"LOCATION{,o=a,t=t}";"SUBLOCATION{,o=a,t=t}";"AMOUNT";"sum"?>).
    Also how the Dynamic variables (preceding with $) Play a role in Pivot table generation?
    Thanks!!!

    table name, row_element_names, column, cell value , to sum or not.

  • How to extend No. of columns for PIVOT table in BI Publisher Desktop

    Hello Everyone,
      I am using the Oracle BI Publisher Desktop to design the TEMPLATE for Oracle Reports.
    I need to create the PIVOT table .In my PIVOT table I need to display 9 columns but when I tried to create PIVOT table by dragging 9 columns only first 4 columns are displaying in report.
    Can anyone suggest me how can I increase the number of columns in PIVOT table?
    Thank You.
    Regards,
    Guru.

    hi jim
    if you carefully look inside the form field's you will find the logic of sort . if you remove that you will get the data without any sorting order.
    else send me your template and xml to my email id i can look into that .
    email : [email protected]

  • Modify Pivot Table in BI Publisher Template

    Hi,
    I've a crosstab report requirement in BI Publisher. Suppose I've 2 row-items, 1 column-item(Month) and 3 datapoints. In BI publisher template builder->pivot table wizard I found only option is there to display datapoint columns one after another vertically. So for each Month(column item) 3 columns are coming, total no. of columns for data points: 12x3=36 + 3 Total columns; ie total 39 columns. Also for two row-items 2 columns are coming. So all together in one sheet 41 columns are coming and it has become difficult to manage.
    Hence, I want to display the datapoint columns one above another, so that 13 column only (12 columns for datapoints + 1 column for Total) come instead of 39 columns.
    Please let me know how can it be done from BI-publisher template builder. Simple XML source taken from a table is used behind this template. Can the requirement be achieved by modifying XML source format or XSL-FO output taken from the template? Please help.
    Regards..

    Insert a table with 3 columns and 2 rows..
    split the (2,2) cell into 3 rows and (2,3) cell into 3 rows..
    table cell (1,1)<?horizontal-break-table:1?>
    (1,2)Sales
    (1,3)<?for-each-group@column:SALE;./YEAR?><?YEAR?><?end for-each-group?>
    (2,1)<?for-each-group:SALE;./REGION?><?variable@incontext:G1;current-group()?><?REGION?>
    (2,2) 1st row Software
            2nd row Hardware
            3rd row Services
    (2,3) 1st row<?for-each-group@cell://SALE;./YEAR?><?sum ($G1[(./YEAR=current()/YEAR)]/SOFTWARE)?><?end for-each-group?>
    2st row<?for-each-group@cell://SALE;./YEAR?><?sum ($G1[(./YEAR=current()/YEAR)]/HARDWARE)?><?end for-each-group?>
    3rd row<?for-each-group@cell://SALE;./YEAR?><?sum ($G1[(./YEAR=current()/YEAR)]/SERVICES)?><?end for-each-group?><?end for-each-group?>the xml file I used was mentioned in tim's blog in the previous reply of mine...I tried it and I got the desired o/p..
    Edited by: user10280715 on Apr 8, 2009 8:58 AM

  • Performing a specific calculation in a pivot table with BI Publisher 10g

    I am using BI Publisher 10g and new on it and I need to integrate a specific calculation measure in a pivot table
    The logic uses two measures that already exist in the report (Demand & PAB) and the required calculation is represented by a new measure/row (Calculated). The pivot time is in weeks
    Week w0     w1     w2     w3     w4     w5 .....
    Demand     d(w0)     d(w1)     d(w2)     d(w3)     d(w4)     d(w5) .....
    PAB     p(w0)     p(w1)     p(w2)     p(w3)     p(w4)     p(w5) .....
    Calculated     c(w0)     c(w1)     ....     ....     ....     c(w5) .....
    If p(w0) < d(w1) --> then c(w0) = p(w0) / d(w1)
    If not
    If p(w0) < d(w1) + d(w2) --> then c(w0) = p(w0) / ( d(w1) + d(w2) ) * 2
    If not
    If p(w0) < d(w1) + d(w2) + d(w3) --> then c(w0) = p(w0) / ( (dw1) + d(w2) + d(w3 ) ) * 3
    If not
    etc .... Same logics apply for c(w1) and so on
    Is such calculation logic achievable in Bi Publisher ? If yes, how would you do it ?
    Thanks for your time and support on this
    Regards, Samir
    Edited by: skaroui on 02-Mar-2012 05:50
    Edited by: skaroui on 02-Mar-2012 06:02
    Edited by: skaroui on 02-Mar-2012 06:12

    Can you use the logic that you specified in the data model (query) to generate the required data and then use it in the pivot table? That would be the easiest way to do it. Tweaking the code to include the conditional logic/calculated measures is not going to be straightforward..
    Thanks,
    Bipuser

  • Creating Pivot Table in XML Publisher having Completed Warning Status

    Hi guys,
    I really need you expertise on this. please help :(
    - I created a Conc. Program that has XML ouput Named Sales Report.
    - Then I connect that to my sales.RTF template.
    this is always been what i'm doing and its fine but my case now is that.
    - Creating my .RTF template in ms word, I used PIVOT table. It is okay when I loaded the xml there then view ouput.
    but when I upload it in oracle and connect to my concurrent Program there report is 'Completed Warning Status'
    Does anyone have any idea why? or is there anyway I can produce Pivot report with xls output?
    Thanks in advance.
    RDBMS : 11.1.0.7.0
    Oracle Applications : 12.1.3
    regards,
    Randy

    Hi There,
    I am encountering the same and I wonder if you've ever got it resolved. If yes would you please share the solution?

  • In Pivot table how to show folder heading of a Measures column

    Hi gurus
    I am using 11.1.1.6.6 version
    Any idea how to show column heading of a measure column in Pivot table view.
    for Dimension its working fine
    I have 3 dimension column and 12 measure column in my report

    Hi Santosh Sutar,
    Did you mean that you want to hide/show the rows in an worksheet? If I understood correctly, there is no such API in apps for Office at present. Most of functions are used interop with data.
    If you want apps for Office to support this function, I suggest that you submit the feedback from link below:
    Customer Feedback for the Office Developer Platform
    And you get learn more about apps for developing from link below:
    Build apps for Office
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Aggregate Function for Text Column???

    Hi,
    Is there a way to group a column's values appearing in multiple rows ( all having some similarity) to be grouped into one single column in one Single Row??
    To be more precise,
    do we have an Aggregate function which would group values ( may be using commas for separation) for a single column appearing in multiple rows when "grouped By" on some condition.

    See here:
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    Rgds.

  • Using CURRENT_DATE function in DATE column

    Hi
    I am not able to use CURRENT_DATE function in my target DATE column.I am getting error like "EDATE": invalid identifier with defintion as 'Insert PK error'. This column is not there in the source table.
    Data Transfer from Oracle to Oracle
    IKM = SQL Incremental Update
    CKM = SQL Check
    LKM = LKM SQL to SQL

    Hi Shaishavi,
    check your Target datastore in Model whether it contains the DATE column or Not.
    have you use this Date column in PK?.
    Colud you please sent me the Error command which you have faced? And tell me about the interface detaily.
    Thanks,
    Madha.

  • Math function ' ' on Date columns is showing incorrect results. Pls xplain!

    Hi guys,
    I'm having a query wherein two date columns are used. One holds just the date part and the other date+time.
    Columns are: - processing_date (holds on date)
    authorised_ts (holds date+time)
    The query is : -
    SELECT a.processing_date,a.authorised_ts,
    SUBSTR(a.processing_date,1,9),SUBSTR(a.authorised_ts,1,9)
    FROM TEBINS01 a WHERE a.ref_instty_code = 'BULK'
    AND a.status_code = 'PPAY'
    AND SUBSTR(a.processing_date,1,9) < SUBSTR(a.authorised_ts,1,9)
    I know that the substr function is creating the problem as it is converting the columns into characters.
    *****The results show that 22-NOV-04 is greater than 12-JAN-05****
    I've tried to use the below query to convert the above 2 dates into number(using to_number) via: -
    SELECT TO_NUMBER(SUBSTR('22-NOV-04', LENGTH(RTRIM('22-NOV-04','1234567890'))-LENGTH('22-NOV-04'))) FROM dual
    The result is 4
    and when I use the above query for 12-JAN-05 the result is 5.
    So even when I convert to number 5 is definitely greater than 4. But how and why is the substr function in the original query giving the wrong results?
    Thanks in advance guys
    B

    As David points out, if the two columns are stored as dates, then you do not need to convert them at all to compare them. The only possible issue may be the fact that processing_date has no time component and authorised_ts has a time component.
    Given the following:
    SQL> DESC t;
    Name                                      Null?    Type
    ID                                                 NUMBER
    PROCESSING_DATE                                    DATE
    AUTHORISED_TS                                      DATE
    SQL> SELECT * FROM t;
            ID PROCESSING_DATE      AUTHORISED_TS
             1 10-Aug-2005 00:00:00 09-Aug-2005 03:51:47
             2 06-Aug-2005 00:00:00 11-Aug-2005 07:44:42
             3 10-Aug-2005 00:00:00 08-Aug-2005 17:18:07
             4 08-Aug-2005 00:00:00 09-Aug-2005 11:45:59
             5 12-Aug-2005 00:00:00 08-Aug-2005 12:56:49
             6 06-Aug-2005 00:00:00 10-Aug-2005 01:43:02
             7 08-Aug-2005 00:00:00 07-Aug-2005 09:23:19
             8 10-Aug-2005 00:00:00 10-Aug-2005 11:04:21
             9 05-Aug-2005 00:00:00 08-Aug-2005 11:29:47
            10 11-Aug-2005 00:00:00 07-Aug-2005 14:51:53You obvioulsy would want id's 2, 4, 6, and 9, but what about 8? The two dates are on the same day. If you only want to consider cases where the day is less (i.e. exclude id 8) then you should query:
    SQL> SELECT * FROM t
      2  WHERE processing_date < TRUNC(authorised_ts);
            ID PROCESSING_DATE      AUTHORISED_TS
             2 06-Aug-2005 00:00:00 11-Aug-2005 07:44:42
             4 08-Aug-2005 00:00:00 09-Aug-2005 11:45:59
             6 06-Aug-2005 00:00:00 10-Aug-2005 01:43:02
             9 05-Aug-2005 00:00:00 08-Aug-2005 11:29:47However, if you hink that id 8 should be included then it is simply:
    SQL> SELECT * FROM t
      2  WHERE processing_date < authorised_ts;
            ID PROCESSING_DATE      AUTHORISED_TS
             2 06-Aug-2005 00:00:00 11-Aug-2005 07:44:42
             4 08-Aug-2005 00:00:00 09-Aug-2005 11:45:59
             6 06-Aug-2005 00:00:00 10-Aug-2005 01:43:02
             8 10-Aug-2005 00:00:00 10-Aug-2005 11:04:21
             9 05-Aug-2005 00:00:00 08-Aug-2005 11:29:47Note that the comparision does not depend on the display format of the date:
    SQL> ALTER SESSION SET nls_date_format = 'mm/dd/yy';
    Session altered.
    SQL> SELECT * FROM t
      2  WHERE processing_date < TRUNC(authorised_ts);
            ID PROCESSI AUTHORIS
             2 08/06/05 08/11/05
             4 08/08/05 08/09/05
             6 08/06/05 08/10/05
             9 08/05/05 08/08/05HTH
    John

Maybe you are looking for