Formula Columns in Data Template

Hi,
Is it posiible to have formula columns in data template apart from summary columns.please suggest.
Regards

You can put those formula-logic in sql query.
summation/avg functions can be used directly in element.

Similar Messages

  • Syntax of formula column in data template

    Hi All,
    I am trying to generate XML output from Data Template. But I am struggling with how to implement formula column. I am using this syntax. But it is not working. Please anybody send me working formula column syntax.
    <element name="PO_NUMBER" value="PO_NUMBER" />
    <function name="CF_DUMMY" dataType="number" >
    <textSource>
    <! [CDATA [
    function CF_DUMMY return number is
    begin
    return 3;
    end;
    ]]>
    </textSource>
    </function>
    </group>

    The call is done directly in the query.
    In your Template header you can reference the database package to use this for example for triggers in your template:
    <dataTemplate .... defaultPackage="myPackage" ...>
    Then your Query looks like
    <sqlStatement name="Q_2">
    <![CDATA[select empno,ename,myPackage.cf_myformula(sal, comm) as Income from emp WHERE deptno=:abeilung]]>
    </sqlStatement>
    In your dataStructure Section you than can reference the formula like any other column
    <element name="INCOME" dataType="number" value="INCOME"/>
    Additionaly you can have triggers like before report trigger, where the logic is in the same database package:
    <dataTrigger name="beforeReport" source="myPackage.beforeRepLogic"/>
    Regards
    Rainer

  • Formulas in XML data template

    Hi All,
    I am unable to keep some formulas in xml data template.
    My exact requirement:
    I want to keep some formula columns in xml data template so that i can show them in rtf.
    I have 6 columns
    1. ename
    2. dept
    3. job
    4. salary
    5. salary deposited till current year ( this is a formula column)
    6. total salary ( this is a formula column ==> salary * comm)
    I am able to keep all the 4 columns and data is being displayed correctly. But i am not knowing where and how to keep the below columns *(i.e., 5 & 6)
    Glad if anyone can provide me with some examples how to keep formula columns in xml data template
    Thanks

    user9092293,
    when you mean "unable to keep column formulas" in data template!!! are you not able to refer to them within the data structure element?? or are you trying to calculate them in the group elements and not able to???
    If you could explain further it might helps us visualize your issue....
    thanks
    -bifacts

  • How to use formula column,placeholder column in data template option

    Hi All,
    Can you some idea on these concept with example.
    Thanks in adv

    >
    formula column,placeholder column
    >
    it's oracle reports terms?
    http://oraclebizint.wordpress.com/2007/08/22/oracle-reports-to-bi-publisher-conversion-utility/
    http://eoracleapps.blogspot.ru/2009/04/how-to-convert-oracle-reports-in-bi.html
    so convert your oracle reports to bi publisher and you'll see mapping for your case

  • How to implement place holder columns in data template

    Hi,
    I have a requirement where I have to mimic the functionality of place holder columns in RDF using Data Templates in XML Publisher.
    How can I call a pl/sql function at element level when we try to group records in the data template.
    To make it simple , let us say I have a requirement to retrieve the address of an employee(address line 1,address line 2, city,country)
    In RDF what I do is define 4 place holder columns to capture address attributes, and in a formula column I set values to these attributes. How do I implement this in XML Publisher data template.
    When I tried to implement the above requirement using test variables, I was able to execute a pl/sql function after the group tag, but not within the group tag.
    I got the result for calc_values3 , but didn;t get anythng for calc_values1 and 2
    Data Template:
    <dataTemplate name="XXLCPAY142R" description="online payslip" defaultPackage="XXLCPAY_ONLINEPAYSLIP_PKG" version="1.0">
    <parameters>
    <parameter name="P_ASSIGNMENT_ACTION_ID" dataType="number" />
    </parameters>
    <dataQuery>
    <sqlStatement name="Q_PAYMENT_RUN">
    <![CDATA[
    SELECT PAAPRV.assignment_action_id assignment_action_id
    ,PAAPRV.payroll_action_id payroll_action_id
    ,PAAPRV.run_assignment_action_id run_assignment_action_id
    ,PAAPRV.run_payroll_action_id run_payroll_action_id
    ,PAAPRV.person_id person_id
    ,PAAPRV.full_name full_name
    ,PAAPRV.last_name surname
    ,PAAPRV.assignment_id assignment_id
    ,PAAPRV.business_group_id business_group_id
    ,PAAPRV.assignment_number assignment_number
    ,PAAPRV.registered_employer legal_employer
    ,PAAPRV.abn abn
    ,PAAPRV.grade grade
    ,PAAPRV.payroll_id payroll_id
    ,PAAPRV.time_period_id time_period_id
    ,PAAPRV.period_start_date period_start_date
    ,PAAPRV.period_end_date period_end_date
    ,TO_CHAR(PAAPRV.period_start_date,'DD-Mon-YYYY') period_start_display
    ,TO_CHAR(PAAPRV.period_end_date,'DD-Mon-YYYY') period_end_display
    ,PAAPRV.period_number || ' ' || TO_CHAR(PAAPRV.period_end_date,'YYYY') period_number
    ,TO_CHAR(PTP.regular_payment_date,'DD-Mon-YYYY') pay_date
    ,PAAPRV.date_earned date_earned
    ,PAAF.ass_attribute2 legacy_position
    ,HR_GENERAL.DECODE_LOOKUP('EMPLOYEE_CATG',PAAF.employee_category) paypoint
    ,PPB.name salary_basis
    ,PAAF.people_group_id people_group_id
    ,PAAF.collective_agreement_id cagr_id
    FROM pay_au_asg_payment_runs_v PAAPRV
    ,per_time_periods PTP
    ,per_all_assignments_f PAAF
    ,per_pay_bases PPB
    WHERE PAAPRV.time_period_id = PTP.time_period_id
    AND PAAPRV.assignment_id = PAAF.assignment_id
    AND PAAF.pay_basis_id = PPB.pay_basis_id
    AND PAAPRV.date_earned BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
    AND PAAPRV.assignment_action_id = :P_ASSIGNMENT_ACTION_ID
    ]]>
    </sqlStatement>
    <sqlStatement name="Q_EARNINGS_DEDUCTIONS">
    <![CDATA[
    SELECT PAI.locking_action_id assignment_action_id_elements
         ,PRR.assignment_action_id assignment_action_id_run_ele
         ,PRR.run_result_id run_result_id
         ,PPA.effective_date effective_date_run
         ,PAAF.pay_basis_id pay_basis_id
         ,PETF.element_type_id element_type_id_ele
         ,NVL(PETF.reporting_name
         ,PETF.element_name) element_name_ear_ded
         ,PIVF.input_value_id input_value_id
         ,PEC.classification_name classification_name
         ,PRRV.result_value amount_elements
         ,DECODE( PEC.classification_name
         , 'Earnings' , 1
         ,'Pre Tax Deductions' , 2
         ,'Involuntary Deductions' , 3
         ,'Voluntary Deductions' , 3 ) sort_order_elements
         ,CASE NVL(PETF.reporting_name
         ,PETF.element_name)
         WHEN 'Salary' THEN 1
         ELSE 2
         END sort_order_name
         ,DECODE( PEC.classification_name
         ,'Earnings',1
         ,0
         ) earnings_count
         ,DECODE( PEC.classification_name
         ,'Earnings',0
         ,1
         ) deductions_count     
         FROM pay_action_interlocks PAI
         ,pay_assignment_actions PAA
         ,pay_payroll_actions PPA
         ,per_all_assignments_f PAAF
         ,pay_run_results PRR
         ,pay_run_result_values PRRV
         ,pay_input_values_f PIVF
         ,pay_element_types_f PETF
         ,pay_element_classifications PEC
         WHERE PAI.locked_action_id = PAA.assignment_action_id
         AND PAA.payroll_action_id = PPA.payroll_action_id
         AND PAA.assignment_id = PAAF.assignment_id
         AND PAA.assignment_action_id = PRR.assignment_action_id
         AND PRR.run_result_id = PRRV.run_result_id
         AND PRRV.input_value_id = PIVF.input_value_id
         AND PRR.element_type_id = PETF.element_type_id
         AND PETF.classification_id = PEC.classification_id
         AND PPA.effective_date BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
         AND PPA.effective_date BETWEEN PETF.effective_start_date AND PETF.effective_end_date
         AND PPA.effective_date BETWEEN PIVF.effective_start_date AND PIVF.effective_end_date
         AND PPA.action_type IN ( 'R','Q' )
         AND PRR.status IN ('P','PA')
         AND PEC.classification_name IN ( 'Earnings'
         ,'Pre Tax Deductions'
         ,'Involuntary Deductions'
         ,'Voluntary Deductions')
         AND PIVF.name = 'Pay Value'
         AND PAI.locking_action_id = :assignment_action_id
         ORDER BY sort_order_elements ASC, sort_order_name ASC
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="XXLCPAY_ONLINEPAYSLIP_PKG.BEFORE_REPORT" />
    <dataStructure>
    <group name="G_PAYMENT_RUN" source="Q_PAYMENT_RUN">
    <element name="assignment_action_id" value="assignment_action_id"/>
    <element name="payroll_action_id" value="payroll_action_id"/>
    <element name="run_assignment_action_id" value="run_assignment_action_id"/>
    <element name="run_payroll_action_id" value="run_payroll_action_id"/>
    <element name="person_id" value="person_id"/>
    <element name="full_name" value="full_name"/>
    <element name="surname" value="surname"/>
    <element name="assignment_id" value="assignment_id"/>
    <element name="business_group_id" value="business_group_id"/>
    <element name="assignment_number" value="assignment_number"/>
    <element name="legal_employer" value="legal_employer"/>
    <element name="abn" value="abn"/>
    <element name="grade" value="grade"/>
    <element name="payroll_id" value="payroll_id"/>
    <element name="time_period_id" value="time_period_id"/>
    <element name="period_start_date" value="period_start_date"/>
    <element name="period_end_date" value="period_end_date"/>
    <element name="period_start_display" value="period_start_display"/>
    <element name="period_end_display" value="period_end_display"/>
    <element name="period_number" value="period_number"/>
    <element name="pay_date" value="pay_date"/>
    <element name="date_earned" value="date_earned"/>
    <element name="legacy_position" value="legacy_position"/>
    <element name="paypoint" value="paypoint"/>
    <element name="salary_basis" value="salary_basis"/>
    <element name="people_group_id" value="people_group_id"/>
    <element name="cagr_id" value="cagr_id"/>
    <group name="G_EARNINGS_DEDUCTIONS" source="Q_EARNINGS_DEDUCTIONS">
    <element name="assignment_action_id_elements" value="assignment_action_id_elements"/>
    <element name="assignment_action_id_run_ele" value="assignment_action_id_run_ele"/>
    <element name="run_result_id" value="run_result_id"/>
    <element name="effective_date_run" value="effective_date_run"/>
    <element name="pay_basis_id" value="pay_basis_id"/>
    <element name="element_type_id" value="element_type_id"/>
    <element name="element_name_ear_ded" value="element_name_ear_ded"/>
    <element name="input_value_id" value="input_value_id"/>
    <element name="classification_name" value="classification_name"/>
    <element name="amount_elements" value="amount_elements"/>
    <element name="sort_order_elements" value="sort_order_elements"/>
    <element name="sort_order_name " value="sort_order_name "/>
    <element name="earnings_count" value="earnings_count"/>
    <element name="deductions_count" value="deductions_count"/>
    <element name="calc_values" value="XXLCPAY_ONLINEPAYSLIP_PKG.CALC_VALUES(67772)"/>
    <element name="calc_values1" value="XXLCPAY_ONLINEPAYSLIP_PKG.RETURN_TEST"/>
    <element name="calc_values2" dataType="number" value="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST" function="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST"/>
    </group>
    </group>
    <element name="calc_values3" dataType="number" value="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST"/>
    </dataStructure>
    </dataTemplate>
    CREATE OR REPLACE PACKAGE XXLCPAY_ONLINEPAYSLIP_PKG
    AS
    P_TEST NUMBER;
    P_ASSIGNMENT_ACTION_ID NUMBER;
    FUNCTION BEFORE_REPORT RETURN BOOLEAN;
    FUNCTION RETURN_TEST RETURN NUMBER;
    FUNCTION RETURN_TEST1 RETURN NUMBER;
    FUNCTION RETURN_TEST2 RETURN NUMBER;
    FUNCTION CALC_VALUES(element_type_id number) RETURN NUMBER;
    END XXLCPAY_ONLINEPAYSLIP_PKG;
    CREATE OR REPLACE PACKAGE BODY XXLCPAY_ONLINEPAYSLIP_PKG
    AS
    P_TEST1 NUMBER;
    P_TEST2 NUMBER;
    FUNCTION BEFORE_REPORT RETURN BOOLEAN
    IS
    BEGIN
    P_TEST := 2;
    FND_FILE.PUT_LINE(FND_FILE.LOG,'From Before Report');
    RETURN(TRUE);
    END BEFORE_REPORT;
    FUNCTION RETURN_TEST RETURN NUMBER
    IS
    BEGIN
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Call 1');
    RETURN(P_TEST);
    END RETURN_TEST;
    FUNCTION CALC_VALUES(element_type_id number) RETURN NUMBER
    IS
    BEGIN
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Call 2');
    p_test1 := null;
    p_test2 := null;
    if ( element_type_id = 67772 ) then
    P_TEST1 := 5;
    P_TEST2 := 7;
    elsif (element_type_id = 67804 ) then
    P_TEST1 := 9;
    P_TEST2 := 11;
    end if;
    RETURN(1);
    END CALC_VALUES;
    FUNCTION RETURN_TEST1 RETURN NUMBER
    IS
    BEGIN
    RETURN(P_TEST1);
    END RETURN_TEST1;
    FUNCTION RETURN_TEST2 RETURN NUMBER
    IS
    BEGIN
    RETURN(P_TEST2);
    END RETURN_TEST2;
    END XXLCPAY_ONLINEPAYSLIP_PKG;
    /

    For this, you need to have a master query and child query.
    1) In your master query you will have to identify one unique column and call a pl/sql pkg function which calculates all values for your place holder columns and inserts rows into a pl/sql table with the index as your unique column
    ex: Master query returns
    empnum name amount
    1 scott 250
    2 bob 350
    and your calculated value is 10 percent of the amount
    your pl/sql pkg should insert records into the pl/sql table like r(1):= 250*0.1 = 25 r(2):= 350*0.1 = 35
    2) The child query will get executed for each row of you rmaster query, so you should be able to read the values based on which master records row it is executing for
    Please bear in mind that you have to make sure that the report is not executed by two different people at the same time, else you have to consider session or any other unique identifier in addition to your master records unique identifier.
    Cheers,
    Girish.

  • Formula Column in Report template

    I have a report template to use in all the report. I want to have a formula column on it to take a control value(location/Organization) where the report is being printing. Is it possible to have a formula column in a report template? if it possible how can I do it? otherwise how can i achieve this task?
    Thank in advance
    Muza.

    What is the application release?
    Can you find any details about the error in the OPP log file?
    Please search MOS website for "Cannot view XML input using XSL style sheet" and go through the docs.
    Thanks,
    Hussein

  • Blob Column in Data Template

    Below is simple Example I tried and output doesnot look right.
    Note: My Blob Database Column is "LOGO".
    Sample Data Template:
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <dataTemplate name="Employee_Listing" description="List of
    Employees">
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT EMPNO,ENAME,JOB,LOGO from
    EMP]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_EMP" source="Q1">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME"/>
    <element name="JOB" value="JOB" />
    <element name="LOGO" value="LOGO" />
    </group>
    </dataStructure>
    </dataTemplate>
    Sample Ouput Created
    <?xml version="1.0" encoding="UTF-8"?>
    <EMPLOYEE_LISTING>
    <LIST_G_EMP>
    <G_EMP>
    <EMPLOYEE_NUMBER>999</EMPLOYEE_NUMBER>
    <NAME>PILLAI</NAME>
    <JOB>MGR</JOB>
    <LOGO/>
    </G_EMP>
    </LIST_G_EMP>
    </EMPLOYEE_LISTING>
    My Question is :
    Does output should have only a TAG for Blob Column or it should have image data
    which can be rendered through Template using fo:instream tags.
    Am I hitting any bug which is preventing retrieving Blob data through XML data template

    I need to get data out of a BLOB column from a table in an Oracle 8i database and into a file that I can put into a MS Word template. The data in the BLOB column came from a MS Word document. What is the best way to proceed? We have a LOB datatype sample which shows how to save a blob from the DB to a local file at http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
    I'd save it to a temp file and then using word add it. You could also spawn wscript.exe to run a Windows VB Script to automate word from the java application.
    Rob

  • How to add a formula column in a report

    Hi
    I have made a report based on a query.
    There are 3 columns in the query and all the 3 are displayed.
    Now I want to add a new column (fomula column) to the report.
    I want to write a query inside the formula column. To execute the query col1, col2 and col3 values are required in the formula column.
    Could you please tell me how to add a formula column in the report and how to pass database column value to inside the formula column
    regards

    Here is how you would create a formula column:
    Open data model of the report.
    Formula column button is on the left side of the tool palette.
    Click on that button.
    Now click in the query group where you want to place the formula column.
    You would see a new field something like CF_1. That is the formula column.
    Double click on the field CF_1. It will open property inspector.
    You would see, Datatype of the formula column is Number. Change this as per your requirement.
    Double click on PL/SQL Formula property. It would open up a editor. Here you can write the code.
    And now to access the data model column here, you can use : and column name. i.e. :col1 or :col2, etc
    And remember you have to return the value back to the formula column. Like this: RETURN(some value).
    You can also take a help from here:
    http://download.oracle.com/docs/html/B13895_01/orbr_howto.htm#sthref1309
    Hope this helps.

  • Formula column equivalent in Data Template

    Hi all,
    I'm working with my first data template and fumbling my way through. I was able to generate the XML output and apply my template. I have some idea on how to burst too, but I'm stuck on how to get the current user's email address. In Oracle Reports, I could just create a formula column and get any specific information needed. How do I do the same in Data Templates?
    TIA,
    Alka

    HI,
    Can I know How can we create the formula column like if then else logic in the Data template?
    Regards
    Boopathi

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • Applying order by for the data comming from the formula column

    Dear Friends,
    I am having a report in which some of the columns in which data is comming from the formula columns,but i need the data in asc order.
    How can i do it.
    Please advice.

    I am having a report in which some of the columns in
    which data is coming from the formula columns,but i
    need the data in asc order.Lets say you have this query:
    select empno, sal, comm from emp
    And you have empno, sal, comm and a formula column 'f_percentage' in one group. Add one dummy column in the query, like this:
    select 'temp' temp, empno, sal, comm from emp
    Move this 'temp' column into the second group (drag and drop outside the first group). You don't have to create repeating frame/or need to show this 'temp' column on the report.
    Now if you use break order on formula column, that should work. Make sure you have break order on other columns also. Arrange items (change order) in data model as you needed. Run your report before and after this change and make sure you have same number of rows before and after this change.
    (from reports builder's help)
    "Break Order has no effect on columns that belong to the lowest group of a particular query. Break Order only affects columns in groups that are above the lowest child group of a query"

  • Suppress Missing Data not work in web form with formula column inside

    Dear All,
    I've a planning web form with formula column inside to calculate the variance and % variance. But missing cell can't be suppressed, although I've checked the 'Suppress Missing Blocks' and 'Suppress Missing Data' options.
    Anyone have face the same problem..?? and how to fixed it..??
    thanks.
    Regards,
    VieN

    There is a known issue that sounds like the problem you are experiencing
    10358200 - If a formula column exists in a data form, selecting the Suppress missing option does not hide rows that do not contain data.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Formula column help needed(urgent)

    Hi ,
    I am using the data template for generating XML data.
    BIP provided functions like SUM(), AVG(), COUNT(), MAX(), etc to use as
    below
    <group name="G_DEPT" source="Q1">
    <element name="DEPT_NUMBER" value="DEPTNO" />
    <element name="DEPTSAL" value="G_EMP.SALARY" function="SUM()"/>
    <group name="G_EMP" source="Q2">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME"/>
    <element name="JOB" value="JOB" />
    <element name="SALARY" value="SAL"/>
    </group>
    </group>
    but suppose if I want to do a sum like
    Sum(ALLdebits - All credits - All refunds).
    We use to have formula good old formula column. like in ORACLE Reports...
    below is my query in the data template....can someone please suggest?
    <dataTemplate name="R007" dataSourceRef="xyz">
         <properties>
              <property name="include_rowsettag" value="false"/>
              <property name="include_rowtag" value="false"/>
              <property name="xml_tag_case" value="as_are"/>
         </properties>
         <parameters include_in_output="false">
              <parameter name="DATE_FROM" dataType="varchar2" include_in_output="false"/>
              <parameter name="DATE_TO" dataType="varchar2" include_in_output="false"/>
              <parameter name="BANK_GIRO_NUMBER" dataType="varchar2" include_in_output="false"/>
         </parameters>
         <dataQuery>
              <sqlstatement name="Q1">
                   <![CDATA[SELECT
    DISTINCT
    SYSDATE               todayDate
    ,substr(trim(CR_BG_NO),3,8)              creditorBGNumber
    ,CREDITOR_SHORT_NAME   creditorName
    ,COUNT(*) itemCount
    FROM
    R00777_REPORT R1
    WHERE
    R1.TXN_DATE BETWEEN TO_DATE(:DATE_FROM,'YYYY-MM-DD') AND TO_DATE(:DATE_TO,'YYYY-MM-DD') AND
    R1.CR_BG_NO = :BANK_GIRO_NUMBER
    GROUP BY
    substr(trim(CR_BG_NO),3,8)        
    ,CREDITOR_SHORT_NAME]]>
              </sqlstatement>
              <sqlstatement name="Q2">
                   <![CDATA[
    SELECT
    TXN_DATE
    ,substr(trim(CR_BG_NO),3,8)
    ,PAYMENT_TYPE
    ,TXN_SERIAL_NO
    ,decode(PAYMENT_TYPE,'AGDEBIT_TRANSFER',DR_TXN_AMOUNT,'AG_REFUND',-RE_TXN_AMOUNT,'AGCREDIT_TRANSFER',-CR_TXN_AMOUNT)
    SIGN_AMOUNT
    FROM
    R00777_REPORT R2
    WHERE
    R2.TXN_DATE BETWEEN TO_DATE(:DATE_FROM,'YYYY-MM-DD') AND TO_DATE(:DATE_TO,'YYYY-MM-DD')
    AND R2.CR_BG_NO = :BANK_GIRO_NUMBER
    ]]>
              </sqlstatement>
         </dataQuery>
         <dataStructure>
              <group name="response" source="Q1">
                   <group name="head" source="Q1">
                        <element name="itemCount" value="itemCount"/>
                        <element name="todayDate" value="todayDate"/>
                        <element name="creditorBGNumber" value="creditorBGNumber"/>
                        <element name="creditorName" value="creditorName"/>
                   </group>
                   <group name="list" source="Q2">
                        <group name="listItem" source="Q2">
                             <element name="transactionDate" value="TXN_DATE"/>
                             <group name="transactions" source="Q2">
                                  <group name="transaction" source="Q2">
                                       <element name="transactionType" value="PAYMENT_TYPE"/>
                                       <element name="serialNumber" value="TXN_SERIAL_NO"/>
                                       <element name="amount" value="SIGN_AMOUNT"/>
                                  </group>
                             </group>
                             <element name="netSum" value="transaction.SIGN_AMOUNT" function="SUM()"/>
                        </group>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>

    Hi Rainer,
    Many Thanks for your reply
    I had done all the calculations in the report view earlier
    and when i accessed it in the data template as follows
    <element name="netSum" value="netSum" />
    the xml output that i got was like
    <R007>
    <response>
    <head>
    <itemCount>8</itemCount>
    <todayDate>2009-02-05T15:50:12.000+01:00</todayDate>
    <creditorBGNumber>01829209</creditorBGNumber>
    <creditorName>ANDROMEDA</creditorName>
    </head>
    <list>
    <listItem>
    <transactionDate>2008-09-03T00:00:00.000+02:00</transactionDate>
    <netSum>-6647999</netSum>
    <transactions>
    <transaction>
    <transactionType>AGCREDIT_TRANSFER</transactionType>
    <serialNumber>5</serialNumber>
    <amount>-1687200</amount>
    </transaction>
    </transactions>
    </listItem>
    </list>
    </response>
    </R007>
    But the output that i want is something like this
    <R007>
    <response>
    <head>
    <itemCount>8</itemCount>
    <todayDate>2009-02-05T15:50:12.000+01:00</todayDate>
    <creditorBGNumber>01829209</creditorBGNumber>
    <creditorName>ANDROMEDA</creditorName>
    </head>
    <list>
    <listItem>
    <transactionDate>2008-09-03T00:00:00.000+02:00</transactionDate>
    <transactions>
    <transaction>
    <transactionType>AGCREDIT_TRANSFER</transactionType>
    <serialNumber>5</serialNumber>
    <amount>-1687200</amount>
    </transaction>
    </transactions>
    <netSum>-6647999</netSum>
    </listItem>
    </list>
    </response>
    </R007>
    Hence I used the BIP built in template function like this
    <element name="netSum" value="transaction.SIGN_AMOUNT" function="SUM()"/>
    but the sum() function is adding up all amounts as expexted,I want
    the above newsum value as
    Sum(AGdebit-AGCREDIT-AG_refund).

  • Sum of Elements in Data Template

    Dear Members,
    I am developing a report using Oracle BI Publisher 10.1.3.
    We are on E-Business Suite R12. I am using Data Template to Generate xml.
    Following is my element structure in Data Template:
    <dataTrigger name="afterParameterFormTrigger" source="XX_TEST_PKG.afterpform" />
    <dataStructure>
      <element name="P_REQUEST_ID" dataType="number" value="XX_TEST_PKG.P_REQUEST_ID" />
         <group name="G_PRODUCT" source="Q_MAIN">
           <element name="PROD_ITEM" dataType="varchar2" value="prod_item" />
           <element name="PROD_DESCR" dataType="varchar2" value="prod_descr" />
           <element name="PROD_ORGANIZATION_ID" dataType="number" value="prod_organization_id" />
           <element name="PROD_ITEM_TYPE" dataType="varchar2" value="prod_item_type" />
           <element name="prod_resources" dataType="number" value="prod_resources" />
           <element name="CS_TOTAL_EXT_COST" function="sum" dataType="number" value="G_ING.EXT_COST" />
            <element name="PERIOD_CODE" dataType="varchar2" value="period_code" />
               <group name="G_ING" source="Q_MAIN">
                   <element name="LINE_NO" dataType="number" value="LINE_NO" />              
                   <element name="LINE_TYPE" dataType="number" value="LINE_TYPE" />
                   <element name="ING_ITEM" dataType="varchar2" value="ING_ITEM" />
                   <element name="ING_ITEM_ID" dataType="number" value="ING_ITEM_ID" />
                   <element name="ING_DESCR" dataType="varchar2" value="ING_DESCR" />
                   <element name="ING_ORGANIZATION_ID" dataType="number" value="ING_ORGANIZATION_ID" />
                   <element name="QTY" dataType="number" value="QTY" />
                   <element name="ING_COST" dataType="number" value="ING_COST" />
                   <element name="EXT_COST" dataType="number" value="EXT_COST" />
               </group>
        </group>
    </dataStructure>I want to sum elements by name CS_TOTAL_EXT_COST and prod_resources and put that value under G_PRODUCT.
    I tried the following but it did not work:
    <element name="SUM_TEST" dataType="number" value="XX_TEST_PKG.SUM_TESTING(:CS_TOTAL_EXT_COST,:prod_resources)" /> XX_TEST_PKG.SUM_TESTING is a function which sums the input parameters.
    In report Builder this was very easy. I would have created a formula column and summed up what ever elements i want. I am not sure how do we do this in Data Template?
    Thanks
    Sandeep

    Any Ideas on how to Achieve the Sum of a Summary Column(CS_TOTAL_EXT_COST) and a Column(prod_resources) using data template?
    As i mentioned before in reports builder, this can be achieved by creating a formula column and summing both columns.
    I am not able to understand how do we do this in Data Template?
    I can also sum those elements in MSWord Rtf Template, but are there any other options.
    Thanks
    Sandeep

  • NEED ADVICE about Inserting a custom formula column in EXPANSION memberset

    Dear all:
    I am asked to create a report with TIME(col), ACCOUNT(col), PRODUCT(row), where ACCOUNT stores Beginning Inventory Amt, COS, etc.
    The problem I am having is that the user requests to have a place to show COS ratio column. COS ratio value is derived from ACCOUNT COS and ACCOUNT NETSALES of my ACCOUNT MEMBERSET.
    I tried various ways but was unable to keep the formula in EVDRE so this COS ratio column's formula goes with the rest of the expansion.
    The result I want is something like below, where NETSALES and COS are my dimension members and RATIO is Excel formula STDCOST/COS... As the report expands by different TIME hierachy (i.e. 2008.total, 2008.h2, 2008.q3), RATIO is expanded accordingly.
    Is this doable in EVDRE?
                                       2008.10                                      2008.11                                      2008.12
                    NETSALES     COS     RATIO         NETSALES  COS   RATIO          NETSALES   COS      RATIO
    PRODUCT1
    PRODUCT2
    PRODUCT3

    Sarcasm?
    You can create a hundred different evdre templates and still not know everything about evdre and its functionality keeps growing. Nothing beats experience here. Iu2019m not able/allowed to provide examples, perhaps one of your colleagues? Or another forum participant?
    1) The online help is good and the Best Practice guide is also very good. I canu2019t send the evdre guide and it is not published by SAP. You can get the BPC for Office Useru2019s Guide;
    Support Portal u2013 Release & Upgrade Info u2013 Install & Upgrade Guides u2013 SAP BPC u2013 (Select your BPC release)
    Office User Guide
    https://websmp101.sap-ag.de/instguidescpm-bpc
    Grab the BPC 7 version as well, it has some better samples.
    To fully capitalize on the fullness of evdre you also need an expert level knowledge of excel, (and I donu2019t mean lots of experience). Evdre is the combination of BPC functionality and excel working in union with each other. VBA is also important in very complex situations.
    2&3) This is one approach. One of the nice features in evdre is the ability to insert excel formulas within a data range. You may need to adjust your row/col key range to address your needs.
    There is nothing really wrong with using dimension logic. Itu2019s important to understand you will take a performance hit somewhere and you should test to determine if the performance hit is within an acceptable range. I have one client with a few hundred accounts with formulas and there application works great and the performance is not to terrible.
    Also look at the following;
    How to Maximize Advanced Formatting for BPC 5.x
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70573b01-657a-2b10-a2b2-ec54bb0a9c8c
    SAP Business Planning and Consolidation 7.0 - Excel Reporting Using EVDRE
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30d193bd-26e8-2a10-719c-cea716a1a418
    Best Practices for Reporting within SAP Business Planning and Consolidations 5.0
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2006e603-ac28-2a10-e589-db05ca5210b7

Maybe you are looking for