Formula column as parameter

Hi All,
I have a formula column and I want to display this formula column as paramter in the report.
Kindly help...
Thanks..

user12058432 wrote:
Thanks for the reply..
Actually I have a computed value i.e., formula coumn and this should appear as a parameter so that the records can be filtered based on
this value..
Thanks..use before parameter trigger
do your computation there
pass the computed value to a parameter
so that your parameter get value when parameter form appears

Similar Messages

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

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

  • How to use a Formula Column in the main query?

    Hi All,
    I've tried to use a formula columns defined in some query in the condition of that query like this:
    where (:cf_ex - :cf_ex2) >= 5
    but when I run the report no data returned! Why? and how to use it the condition of the query?
    Note: I'm using Forms 6i

    where (:cf_ex - :cf_ex2) >= 5You cannot do that. Formula columns are not part of the select statement (which runs in the database), but are processed in the report.
    When you created this query, my guess is that you got the message "Note: the query Q1 has created the bind parameter(s) cf_ex, cf_ex2". Check these User Parameters in your data model. So, you are actually referencing user parameters in the query, not formula columns.
    I made a computations and things using PL/SQL that can't be done in the select statement in the data model!If it's pl/sql you can probably use that in your query. Create some database functions for cf_ex and cf_ex2 and use these in your query.

  • Dynamic SQL in Formula Column in OracleReports6i

    Following code is in formula column of my report. passing dynamic sql str1(actullay, this string comes from after parameter trigger form) into SQL and executing thru DBMS_SQL.PARSE function. it's failed with 'Fatal PL/SQL error occured' ...
    Coupld any one help me on this...
    function CF_1FORMULA0006 return Number is
    Credits1 NUMBER(10,2);
    str1 VARCHAR2(50) := 'AND b.PROGRAMID = 2 ';
    c1 INTEGER := dbms_sql.open_cursor;
    c2 INTEGER;
    begin
    begin
    dbms_sql.parse(c1,
    'SELECT NVL(SUM(a.AMOUNT),0) INTO Credits1' &#0124; &#0124;
    'FROM SPONSOR_TRAN_DATA a, SPONSOR b ' &#0124; &#0124;
    ' WHERE ' &#0124; &#0124;
    ' a.TRANTYPE = 41 ' &#0124; &#0124;
    ' AND a.SPONSORID = b.SPONSORID ' &#0124; &#0124;
    str1 &#0124; &#0124;
    'AND a.amount > 0 ' &#0124; &#0124;
    'AND a.timestamp >= :reportdate ' &#0124; &#0124;
    'AND a.timestamp < :reportdate + 1' ,2);
    c2 := dbms_sql.execute(c1);
    exception
    when no_data_found then
    Credits1 := 0;
    end;
    return Credits1;
    end;
    Thanks in advance......

    It looks like forms are not supporting text functions like FR yet, I gave it a try <<MemberName("<Formname>","<POV DIM Name>)>> in the formula header area and it didn't like it. It is just displaying what ever I typed in there.

  • Using In operator in Formula Column,URGENT!!!!!!!!!

    Hi...
    I want to ask if I have a formula Column(REPORTS 6i),and I want in where condition using parameter to some condition as this example:
    function CF_1Formula return Number is
    S NUMBER(10);
    begin
    SELECT SUM(SAL) INTO S FROM EMP
    WHERE DEPTNO IN (:DEPT);
    RETURN(S);
    end;
    Where :DEPT is user parameter of char Datatype and it is value 10,20 and may be 10,30,40
    and so on.
    on runtime the sql will be:
    SELECT SUM(SAL) INTO S FROM EMP
    WHERE DEPTNO IN (10,20);
    but this not work.So what is the correct way to deal with this sql stat.,
    and :dept always have different values.
    So PLS any ONE help me ASAP

    Something like this will work (10g onwards)
    SQL> ed
    Wrote file afiedt.buf
      1  with req as (select '&required_empnos' as empno from dual)
      2  --
      3  select *
      4  from emp
      5  where empno in
      6    (select regexp_substr(empno, '[^,]+', 1, rownum)
      7     from req
      8*    connect by rownum <= length(regexp_replace(empno, '[^,]'))+1)
    SQL> /
    Enter value for required_empnos: 7839,7499,7934
    old   1: with req as (select '&required_empnos' as empno from dual)
    new   1: with req as (select '7839,7499,7934' as empno from dual)
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
    SQL>

  • Formula column in BI

    Hi all and Raineer
    i have written a formula column in the below Data template and it is not giving any result for the id element when i view the xml output
    <dataTemplate name="data_template" description="Template_description" dataSourceRef="TFUAT">
         <parameters>
              <parameter name="org_id" dataType="number" defaultValue="121"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="Q1">
                   <![CDATA[SELECT party_name FROM
    apps.hz_parties where rownum<10
    ]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_temp" source="Q1">
                   <element name="ite_use_id" value="party_name"/>
                   <element name="id" dataType="character" value="FormulaProfitMargin"/>
              </group>
         </dataStructure>
         <programUnits>
              <function name="FormulaProfitMargin">
                   <![CDATA[
          FUNCTION FormulaProfitMargin RETURN number IS
          BEGIN
            return (10);
          END;
        ]]>
              </function>
         </programUnits>
    </dataTemplate>
    thank you
    Boo

    If I use the suggested way in SQL query, I will have performace issue. My query selects 20 columns 4 among them are with aggregate functions. It is forcing me to do the group by with remaining 16 columns.
    Please provide me the sample code which has alternate way to extract formula.
    Thanks in advance.
    Regards
    Boopathi

  • Oracle 6i Formula Column

    Hi Techies,
    I have an Oracle 6i report which has a parameter form. It takes the argument Contract_Num as an input. Based on the value of the Contract_Num, a formula column displays a string.
    Now I dont want to use the parameter form. I have simply modifed my report group query. I get all the contract_num in the output but the respective string is not displayed as I dont input any Contract_Num in the parameter form. The Formula Column always returns NULL in the all the pages.
    Please advise on how to pass the contract_num to the Formula Column to display the respective string in each page.
    Thanks
    Sri

    Hi Sri,
    As you said you have modified your query, you can directly bind the variable in the formula column as
    : (your variable).
    If your formula is outside your report group. Please place your formula column within that record group and try.

  • Place holder and formula columns help

    Hi All
    Can any one help for me.. how to create placeholder column variable, then how can i assign the variable in formula column to populate.
    As report Output Requirement :
    I have two columns col1 and col2 . based on report parameter (selection type )
    Ex :
    1. select 1 means its need to display col1 , hide the col2
    2. select 2 means its need to display col2 , hide the col1
    3. if they non of selection means need to display both col1 and col2
    can you guide me , how to do task in oracle reports
    Regards
    Sanjay

    Hi Rohit,
    Thanx for ur reply ..
    But when i try to open that link it gives me the following error
    Sorry. This page does not exist.
    The URL you requested could not be found on this server. Please check the spelling in the URL or use our search to find what your are looking for. Thank you.
    Can u suggest me some other place which gives me a precise explanation with some EXAMPLE too ...?
    Thanx again in advance

  • How to make an order on repeating frame using Formula Column?

    Hi All,
    I have a repeating frame dependent on some query, how to make an order on this repeating frame using a formula column defined in its group and dependet on values from the query?
    Note: I'm using Reports 6i

    Place your formula column at the top of the itm group and set the BREAK_ORDER to assc.. or desc...
    Hope this helps
    Hamid
    if problem solved, close the thread.

  • Formula Columns are not working in Reports 10g

    Hi,
    We converted the reports developed in Reports 6i to Reports 10g. When we run the report in Reports 10g Builder everything works fine. But when we deploy the same report in Oracle Application Server and invoking the report the formula columns are not working ie., the fields/ placeholder columns which are based on the formula column are not displaying any values in the report.
    Please, someone help us in this regard.
    Thanks & Rgds,
    M T

    What version of Reports do you use..???
    Greetings...

  • How to display a Sum field for a formula column?

    Hi,
    I need to display a sum for a formula column at the end of report. for example: my formu_col=col_1-col_2
    col_1 col_2 formu_col
    3 1 2
    6 5 1
    total:sum(col_1) sum(col_2) sum(formu_col)
    now i have sum(col_1) and sum(col_2), but i don't have sum(formu_col)
    thanks

    Hi
    You may add a summary column in the same data group that you have sum(col_1) and sum(col_2). In that properties of the new column point the source as formu_col.
    Hope this helps.
    Fouwaaz

  • Using PL/SQL in a formula column in Oracle Reports Builder.

    Hi,
    I need to SUM two record from the result of an SQL interrogation.
    Here's what it looks like
    function CF_1Formula return Number is
    nTot1 NUMBER :=0;
    nTot2 NUMBER :=0;
    begin
         select sum(:TOT1) into nTot1 from table(Q1) ;
         select sum(:TOT2) into nTot2 from table(Q1) ;
         return (nTot1 + nTot2);
    end;I'm kind of new to formula column programming any link of interest would be appreciated.
    The from table(Q1) part Q1 represents my SQL interrogation name and the group below it is G_MAIN.

    Hi Hong Kong King Kong,
    From looking at that function name (and the group name): Is this an Oracle Reports generated function?
    If so, there's also a dedicated Reports forum: Reports
    By the way, I like your synonym for 'query'.
    I'm sure I'll confuse some of my collegues tomorrow when I will mention 'database interrogation' instead of 'query'. ;)
    edit
    Doh...I should not underestimate the information that is posted in thread subjects.
    Edited by: hoek on May 5, 2010 9:24 PM

  • 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 help please - URGENT

    I'm trying to create a formula column as follows:
    function NO_REPLIESFormula return Number is
    NOREPLY number;
    begin
    SELECT COUNT(reply) INTO NOREPLY
    FROM letters
    WHERE reply = 'N'
    GROUP BY ltrtype, batch;
    RETURN (NOREPLY);
    end;
    This PL/SQL compiles fine, but when I run the report, I get the following messages:
    REP-1401 no_repliesformula FATAL PL/SQL error occured. ORA-01422 exact fetch returns more than requested number of rows.
    If I remove the GROUP BY ltrtype, batch, I don't get the error messages, but the result I get is the total no_replies instead of the total no_replies for each ltrtype/batch grouping.
    Could someone please help me with this?
    Thank you.

    Hi irish,
    I think i am not sure about what you are trying to say, but let me guess, You want the values to be return on the bases of "ltrtype, batch". Which mea that you want more then one values, i mean there can be more then one Groups based on ltrtype and batch. and you want to display these values with repective record???
    If i am right, then there is a fault in your code, and that is , you are not specifing in your code that which value is to be diplayed with which record in this report. For that there must be ltrtype, batch colums displayed in the report, you must add those values in your Code in the query, i.e.
    function NO_REPLIESFormula return Number is
    NOREPLY number;
    begin
    SELECT COUNT(reply) INTO NOREPLY
    FROM letters
    WHERE reply = 'N' and ltrtype= :V_ltrtype and batch=:v_batch;
    RETURN (NOREPLY);
    end;
    Where :V_ltrtype and :v_batch are the run time values of each records displayed in the report.
    Remember that if you don't sepecify this then your code will return as many records as many distich values of ltrtype, batch. and your variable NOREPLY can hold only one value at a time. I hope you understand both, Solution and the logic behind the error.
    Please correct me if i am wrong.
    Thanks.
    Mohib ur Rehman

Maybe you are looking for

  • Menu Bar does not work in IE (still not resolved)

    I was long awaiting the 1.6 version of spry to get help with the menubar, but I'm still having the same problem. The submenu does not function correctly in Internet Explorer. I posted a month ago and still haven't received any feedback on how to corr

  • Can't publish an OAM anymore

    Hi there, when I want to publish an OAM I always get this message: "an error occurred. Please save your work and restart Edge Animate." I  tried simple animations in a fresh project just with text, to sort out problems with footage. The publishing ac

  • Can't launch PSE 7

    Why would I not be able to launch PSE 7 after installing from a purchased CD?  (No error msg) (thread title edited by forum host)

  • New to Mozzilla support

    New to Mozilla Support When I'm at the Log-in page, the fonts are not in English # பயனர் பெயர்: # கடவுச்சொல்: Many support pages are not in English and I just guess what they are. Why are Support pages in weird fonts?

  • How Do I download Logic Pro X on my new Mackbook without spending $200 to redownload it?

    I bought Logic Pro X on My Macbook pro about a year back. I just recently purchased the Newer version of the Macbook pro. I am not trying to spend $200 for the software download when I already bought that. Is there anyway to download it on my new Mac