Report output order by formula column value? pls.urgent

hi.
i have one query select empno,ename, sal from emp. in report layout i created a formula column named as net_sal(in which am doing some calculation based on some criteria). now i want to print the report order by net_sal desc.
how can i solve it? since the calculation is being done on runtime only/
pls. help me. urgent

Puedes hacer lo sigte.:
En el SQL QUERY STAMENT
select empno, ename, sal, :net_sal
from emp
order by 4 asc/desc

Similar Messages

  • Can be passed Formula Column value to Procedure/Function?

    Below cf_value is return after some calculation by using main query.
    Can be directly passed formula column value to procedure without assinged to placeorder?
    as below..
    f_convert(:cf_value,new_value);
    My Procedure is...
    PROCEDURE f_convert( val1 in number,val2 in out number) IS
    BEGIN
    val2 := val1 * 100;
    END;
    If anyone knows pls reply me....

    Actually, if there is any other calculations there (In Proceudre)
    Can I used is as below??
    PROCEDURE f_convert( val1 in number,val2 in out number) IS
    BEGIN
    val2 := val1 * 100;
    return (val2);
    END;
    ----A procedure cannot return a value, the return clause in my previous post was part of the function for formula column.
    Suppose you have a formula column say CF_2 then the function for it will be as:
    function cf_2formula return number
    is
    val1 number;
    val2 number;
    begin
    val2 := :cf_1 * 100; -- or val2 := val1 * 100 --parameters not allowed in formula column function
    -- All the other code that you need inclusive of calling function, procedure as in any PL/SQL block can be placed
    return (val2);
    end;So any other calculation can be used in the formula column function

  • Exception (colouring cells) in report output based on formula.

    Hi Gurus,
    I want to colour my cells in report output. But this coloring is not so simple. It has to be done based on a formula.
    Lets say i have material in rows and sales value by period in columns.
    .......................Jan'08......Feb'08.......Mar'08.....Apr'08
    Material A...........100..........120............105.........140
    If Feb'08 values is greater than 0,02*Jan'08 value than ---> Feb'08 has to be coloured as green. etc.
    Is it possible to define such a rule for the exception?
    Thanks
    S.P.

    Hi Reddy,
    I am using bex 7.0.
    I tried that also.
    I created another formula in columns with name "Difference" and it calculates the difference.
    Report looks like as below:
    Material.....Jan'08.......Feb'08.....Difference
    ABC............100............120.............0,2
    Now, I have to colour Feb'08 column, based on the value under Difference column. But it does not work.
    In Exception settings; from Definition tab, I selected Difference column (exception is based on).
    In Display tab, I select Feb'08 column.
    But it does not work.
    Any idea?
    Thanks
    S.P.

  • Report painter variables in formula columns

    Hello,
    I need to insert variable in column formula to create  average month result.
    using syntax 'variable' or &variable is Incorrect formula component message .
    How can i enter variables in formula columns?
    Thanks ,
    Ran

    Hi
    I suspect you are not able to use the '& symbol in the formula in your system because the note 593897 was not present in old release.   
    Due to this note there is no need to enter '&' symbol for variables in the formula but in order for the variables to be used please make sure  that the variable is contained in the general data selection of the  report.                                                                
    Kidn Regards
    davide

  • Formula column value not updating in table?

    Hi all,
    I create the sample for master/detail form. In detail for prdcode,rate,qty,amount is there. When select prdcode it fetching prdcode,rate in a record and if you type the qty the amout will come based on formula(property) :qty*:rate.
    It is available on screen. But when i store the data, in backend table the amount is be a null.
    What is the problem.
    Help me in this regards,
    kanish

    Hi kanish
    Regarding Nul...
    -u have to make sure that the formula is working fine and displaying the result in the form screen
    -then the item u r storing MUST be a db item >yes and has a column name
    -first of all select Help > display_error in the forms runtime may a db item error arais and the record is not correctly saved as u imagined.
    u have 2 choices for the solution , i had both before may be it's not very cute but it will work...
    1. In when-validate-item Trigger or related item triggers pls follow
    SELECT Nvl(( :qty*:rate ) ,0)
    INTO :UR_ITEM
    FROM DUAL;2.In Pre-Update,Pre-Insert & Pre-Delete Triggers Pls assign the result of ur formula column to the item u want to calc as supposing u r doing the calc of formula in non-db item , then put the following in triggers mentioned ...
    : item_name :=:qty*:rate;Hope this helps...
    Regards,
    Amatu Allah.

  • Can formula column values be used as parameters

    Post Author: vdm
    CA Forum: Formula
    Hi,
    I have various formula columns setup in my crystal report, these formula columns act as prompts when end users run the report. i am using crystal reports xi and sql server databse.
    Now I would like to use these formula columns to restrict my result set. basically, these should act as predicates (where clauses) to my query.
    Is there a way to pass formula columns as parameters to stored procedures or to commands or to simpy add them to a sql query ?
    thanks in advance

    Post Author: foghat
    CA Forum: Formula
    Have you tried adding the formula fields as a filter in the Record Selection Formula editor?So  Report --> Selection Formulas --> Recordand add: {database.field_a} = and {database.field_b} = and so on 

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

  • 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

  • How to do the ALV report output in groups and caluculate the tOTALS(URGENT

    Hi
    In my ALV report output .I have to group the output based on the DAYS field
    0-10 days in one group
    10-30 days in one group
    above 30 days one group
    There is also a field by name "AMOUNT" in my output.
    I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
    Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
    Thanks in Advance

    Please don't repost your questions...
    Check out my answer in your other post.
    How to make the ALV report in groups  and caluculate the TOTALS
    Regards,
    Naimesh Patel

  • FSG report output does not show column headers (XML Publisher)

    Hi everyone
    Iam required to create a template for an FSG report with 20 columns. Used copy of FSG:Fixed number of columns Template(FSGTEMP) to create the template because i need to do some conditional formatting(need to show negative values in red color).
    here is the problem:
    when i use the template and run the program the output i can see the row data but not the column headers..column headings are blank!
    regarding the conditional formatting, can anybody tell me how to give the condition
    iam able to give the condition for oracle reports but not for FSG reports as i dont see the column name in the 'data field' in conditional format
    Regards
    sam

    Open the report in Edit Mode Click on the reports and in the properties section Uncheck the
    Enable Document Cache Property and your issue should be resolved.

  • Report output format xml, missing column while open in excel for single row

    Dear,
    There is a strange case, we have an customize concurrent program to display output in xml format. Now Problem is, if query get single record on the bases of parameter then there is no column heading available in excel. However, if parameter meet more than one record then there is no issue with column heading and reports is working find.
    Pls have an idea?

    Dear Pk,
    Here is an example, will show the actual problem. Let explain you, first i have run report by restricting query on single record which output name is "output1", again i run same report by changing where clause so it return multiple row which is "output2". if you past code in text document each one and save it as xml but when you open this file in excel report you will find column heading which rows consist multiple row, however, ouput1 file have no heading columns that's a problem.
    1.Oputput1
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.11.3 -->
    <DEPTNO>
    <LIST_G_EMPNO>
    <G_EMPNO>
    <EMPNO>7839</EMPNO>
    <ENAME>KING</ENAME>
    <HIREDATE>17-NOV-81</HIREDATE>
    <SAL>5000</SAL>
    <DEPTNO>10</DEPTNO>
    </G_EMPNO>
    </LIST_G_EMPNO>
    </DEPTNO>
    2.Oputput2
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.11.3 -->
    <T01103240>
    <LIST_G_EMPNO>
    <G_EMPNO>
    <EMPNO>7788</EMPNO>
    <ENAME>SCOTT</ENAME>
    <HIREDATE>09-DEC-82</HIREDATE>
    <SAL>3000</SAL>
    <DEPTNO>20</DEPTNO>
    </G_EMPNO>
    <G_EMPNO>
    <EMPNO>7902</EMPNO>
    <ENAME>FORD</ENAME>
    <HIREDATE>03-DEC-81</HIREDATE>
    <SAL>3000</SAL>
    <DEPTNO>20</DEPTNO>
    </G_EMPNO>
    </LIST_G_EMPNO>
    </T01103240>
    Hope you got it.

  • Prompt Order when opening Report - And order in List Of Values

    I guess this is a fearly easy question... But I thought easier to ask you guys than struggling all night.
    1 -  I have a report with some prompts.  How do I change the order they appear in ?
    2 - For some List Of Values I have really a strange order. How come ? And What should I do to fix it ?
    Hoping on some good answers in the weekend
    Best Regards
    Ingrid

    Hi Ingrid,
    You can set the "Prompt Order" in "Properties" tab in the Query Panel.
    1.Make sure that you are in the Query Panel.  Make sure that "Edit Query" button is pressed.
    2.Click on the "Properties" tab, just beside "Data" Tab
    3.Scroll down to see the "Prompt Order" option. Select the prompt and use " UP or DOWN" arrows (not the keyboard arrows. Expand the "properties" tab window, if you don't see the arrows) to change the prompt order.
    Thanks,
    Raveendra

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

  • FSG report not printing column values on same line but sequentially

    FSG report problem:
    We have defined 2 FSG reports 'Balance Sheet - Total' and 'Balance Sheet - Detail'. Both reports have 3 column values, namely the value in Euro (our Functional Currency), the value in MUR - Mauritian rupees (our reporting currency) and the rate of exchange.
    The report 'Balance Sheet - Total' displays these values for assets e.g.:-
    EURO MUR Rate of exchange
    Non-current assets
    1. Intangible assets ? ? ?
    2. Other investments ? ? ?
    (note: ? represents a certain value)
    The report 'Balance Sheet - Detail' displays values as follows :-
    Account EURO MUR Rate of exchange
    1. Property & Equipment
    A10101 Building Cost ? 0.00 0.0000
    A20105 Motor Veh Accum Dep ? 0.00 0.0000
    TOTAL ? 0.00 0.0000
    A10101 Building Cost 0.00 ? n/m
    A20105 Motor Veh Accum Dep 0.00 ? n/m
    (note: ? represents a certain value)
    What we don't understand s why the 'Balance Sheet - Detail' report repeats the display of column values in MUR FOLLOWING the display in EURO, instead of displaying column values for EURO and MUR on the same line, just like in the case for 'Balance Sheet - Total'.
    Is there anything in the definition of column set, row set or report set should I change?
    Can anybody help. Thanks.
    null

    The problem is related to defining the column set properly. It is OK with the first report and needs modification for the second. Formatting is also important so that they appear in the same line(row). The columns need to be linked to the fileds and assignment to set of books is also important as mentioned by Rajsekhar

  • Update a list item based sort order of created by column value

    HI
    using powershell script how to sort a list column before update a list  item.
    here i created a document library and uploaded some documents and update ProcessNo column based sort order of created column
    value.
    Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
    $webURL = "http://tspmcwfe:91" $listName = "Courts"
    Get the SPWeb object and save it to a variable
    $web = Get-SPWeb $webURL
    $list = $web.Lists[$listName] 
    $items = $list.items
    Go through all items
    foreach($item in $items)
    $item["ProcessNo"] = 1
    $item.Update()
    $web.Dispose()

    Hi,
    According to your description, my understanding is that you want to sort the list items order before updating items using PowerShell.
    I suggest you can use the Sort-Object command to sort the list items.
    Here are some detailed articles for your reference:
    Better SharePoint Lists and List Items in PowerShell
    Sort-Object
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • In how many computers can i download the creative cloud software?

    my laptop is old and not fast enough if I download illustrator software will i be allowed to download it again to another computer? thanks Beatriz

  • Field labels that won't go away in Address Book

    Help! Many of my contacts have credentials at the end of their names, so I use the Suffix feature to keep track of them. However, for people without credentials at the end of their names, the word "SUFFIX" appears in gray on their contact card, and I

  • What program will open .JPG in email attachment

    Searched the forum but couldn't find an answer.  I keep getting emails with .JPG attachments but it says that there is no program on the phone to open the attachment.  Went to the Play Store and tried a couple but they didn't work.  Probably somethin

  • Problem when form is dynamically added in a tab page

    Following is the requirement: => I placed a button on a tabPage of tabControl. => On click of a button, 1. I created a Control object. 2. I created a Form object. 3. Initialize the Form Object. 4. Initialize the Control object and add it under the Fo

  • Bringing already existing html pages into iWeb, possible???

    My sister is a graphic designer who created some html pages for me using Dreamweaver & GoLive. I want to update the text, images, and tables in these pages, and thought I could use iWeb, but it only wants to let me use it's templates. Am I doing some