Items [ HP ALLBASE/BRW Reference Manual ] MPE/iX 5.0 Documentation
HP ALLBASE/BRW Reference Manual
Items
In HP ALLBASE/BRW, the columns from the data source table are known as
items. Projecting an item means that the values for an item are made
available for the new table and can be used in later tables or reports.
Projecting Items
By default HP ALLBASE/BRW projects all items with unique names from their
source tables to the result table. If items have identical names in a
joined table, only one of them is projected. Therefore, if you want to
project two items with identical names, you must provide alias names (see
below) for all items with identical names.
When the report is compiled, HP ALLBASE/BRW de-selects all unnecessary
items, so that only those items required in the report are projected.
For instance, suppose you accept the default and project all items but
only use certain ones in the report layout or for calculations. HP
ALLBASE/BRW removes the unused items from the final table. This cuts the
size of the tables and improves the report performance.
On the Project Items screen you can change the default projection to:
* Project additional items by giving them unique alias names and
marking them for projection. For joined tables, you can give
unique alias names to items with the same name so that they
project as different items. In a merged table, you can give the
same alias name to items with different names and project them as
one item.
Alias names are only in effect outside the source table; that is,
they do not affect the source tables.
* Exclude items from projection. Excluding items is not necessary
for performance but can help maintain security.
* Change numeric precision of an item when it is projected from a
table.
To exclude items from projection
1. At the Define Table, Define Relation, or Relation Condition
screen, choose Project Items.
All items for all the sources you used for your table appear on
the Project Items screen. By default, all the items contain an X
in the Proj (project) field, meaning that all items will be
projected unless you change the default.
2. Use the Tab or cursor control keys to move to the Proj field for
any items you want to exclude from projection.
3. With the cursor under the X, press the space bar to exclude that
item from projection.
To give a projected item a different name
1. At the Project Items screen, move to the Alias Name field for the
item you want changed.
2. Type a new name for the item.
To change the numeric precision for a projected item
1. At the Project Items screen, move to the NumPrec field for the
item.
2. Type a number and a method code for type N, I,, or R items if you
want to change their numeric precision. (The Type field on the
screen shows S for string and N, I, or R for number.)
Valid numbers are in ranges, depending on the number type for the field:
Item Type Number
---------------------------------------------------------------------------------------
N (fixed-point numeric) -6 to 12
I (integer) 0 to 8
R (floating-point real) -90 to 76
The number is a power of 10 or 10th exponent. Precision applies only to
the result of a calculation. The computation is made at full precision
and any truncation or rounding necessary is performed only after the
computation is complete.
Precision is explained in greater detail in Chapter 15 .
If you change the precision for a number field, you must also tell HP
ALLBASE/BRW what to do with digits that are left over. The letter you
type is a method code indicating how any superfluous digits are treated:
Method Code Digits are: Explanation
---------------------------------------------------------------------------------------
T truncated All the digits outside the precision are dropped.
R rounded Rounded up if the first digit outside the precision
is a 5 or greater and rounded down if the first
digit outside the precision is less than 5.
C ceiled Always rounded up.
Examples
In this example of a joined table, the item AMOUNT has been given an
alias; items without an X in the Project field have been excluded from
projection, and changed numeric precision has been specified for the item
BALANCE-DUE. Only items projected from a table can be used in later
tables or in a report.
Definitions on the Project Items screen only affect how the item is used
outside its source table; they have no effect inside the table.
NOTE HP ALLBASE/BRW always projects a common item from a source table
not subject to an open join, no matter what table you select for
projecting the item. For example: suppose you selected the common
item CUSTOMER-NO to be projected from the open-join table INVOICES.
If there are no invoices for a customer, that customer's
CUSTOMER-NO will contain NO_VALUE, as you projected it from
INVOICES, the open-join source table. (All other information held
in the CUSTOMERS table would be projected normally.) In this case
HP ALLBASE/BRW automatically projects the item CUSTOMER-NO from the
source table CUSTOMERS, so ensuring that all customer numbers are
present in the report.
In the next example, the Project Items screen illustrates how items can
be projected from a merged table:
All the items are projected and the item PRODUCT-NAME has been given the
alias NAME-OF-TOY.
MPE/iX 5.0 Documentation