Skip to Content
avatar image
Former Member

How to add calcuated field in the Query


Can anyone guide me the process to add addtional field say "rate" in the query (sq01) where i am having "Qty" & "Total Amount" fields available from the standard table.

Rate = Total Amount / Qty

Thanks in advance


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Feb 21, 2009 at 05:18 PM

    Hi Tejpal,

    In SQ01

    - Open your query for change

    - Select the field groups that contain the data items you need to use to create your new data item. Move to the field display page.

    - Once you have the field names displayed on the screen, Edit>Short Names>Switch on.

    - Now, find each data item you will need to use to create your new data item. In the short name field create a new 'nickname' for each of these eg 'TOTAMT' and 'QTY' to represent total amount & quantity

    - Now, Edit>local field>create.

    - short name=the name of your new field, eg 'RATE' & Field desc= description of yr new field

    - Heading=how it will be displayed in the header of your output report

    - Select Calculation field

    - Define number of digits and decimal places

    - In the Calculation formula, use the 'nicknames' you previously defined to create your calculation. Simple arithmetic functions are supported, eg 'TOTAMT / QTY' would be the formula

    Hope the above answers your query.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Tejpal,

      Can you let me know the values your passing for the numerator & that for the denominator. Also how have yu defined this field?

      I suspect the overflow is happening because of the field declaration & the values being passed to them.

      Await your inputs.