Skip to main content

Comp Column +-X/

Comments

1 comment

  • Alex

    Looks to be a Computed Column in a Query. You should be able to search for 'Computed Columns' in the Designer Guide to get more info, but here is the short version from the guide:

    Creating Computed Columns in a Query

    You can create computed columns in a query which is based on tables, views, and synonyms from one JDBC connection only.

    1. In the Query Editor dialog box, select New Computed Column on the toolbar or navigate to Menu > Column > New Computed Column. Designer displays the New Computed Column dialog box.

       

    2. Type a name for the column in the Computed Column Name text box.
    3. Compose your functions for the column.

      In the lower part of the dialog box, there are functions and tables/columns of the query. They are just for your reference. You can specify the expression by yourself in the editing text box, only if the expression can be accepted by your database.

      In addition, the functions in this dialog box are not from the Logi Report system. They are from the database you are connecting to. For each database, you may get a different set of the functions. Thus, if you change your database, some of these functions may no longer exist. You can use the following functions to write an expression:

      • String
        Select to use a String formula in the expression.
      • Numeric
        Select to use a Numeric formula in the expression.
      • Time & Date
        Select to use a Time or Date formula in the expression.
      • +
        Select to add the numbers or fields together in the expression.
      • -
        Select to subtract the numbers or fields in the expression.
      • *
        Select to multiply the numbers or fields in the expression.
      • /
        Select to divide the numbers or fields in the expression.
      • =
        Select to equate fields together.
      • "
        Select to place quotations on long character strings or names that have blanks in them. For example, you should place quotes on values such as "New York" or "Washington DC".
      • ||
        Select to place fields together in the same expression. For example, "New York" || "Washington DC".
      • ()
        Select to place fields in parentheses.
    4. Select OK to create the computed column.

    Designer places the computed columns you add to a query in the criteria panel of the Query Editor dialog box together with the table columns in the query. If you want to edit a computed column, you can double-click its name in the criteria panel and then edit it in the dialog box Designer displays.

    After you create a computed column, Designer adds it to the SQL of the query. Suppose you have added a computed column named "Net Total" in a query and the computation is @UNITPRICE * @QUANTITY * (100 - @DISCOUNT) / 100, when you view the SQL statements of the query, you see the following SQL statement being inserted into the SQL: @UNITPRICE * @QUANTITY * (100 - @DISCOUNT) / 100 AS "Net Total".

    0

Please sign in to leave a comment.