Sybase 2 Barcode Reader User Manual


 
Enhancing crosstabs
350 DataWindow .NET
Here CrosstabSum(1) returns the total of sum(units for crosstab) for
the corresponding row.
CrosstabSum(2) returns the total for sum(units *
1.2 for crosstab)
.
For more information
For complete information about defining computed fields, see Chapter 5,
“Enhancing DataWindow Objects.”
For more about the crosstab functions, see the DataWindow Object Reference
in the online Help.
Cross-tabulating ranges of values
You can build a crosstab where each row tabulates a range of values, instead
of one discrete value, and you can make each column in the crosstab
correspond to a range of values.
For example, in cross-tabulating departmental salary information, you might
want one row in the crosstab to count all employees making between $30,000
and $40,000, the next row to count all employees making between $40,000 and
$50,000, and so on.
To cross-tabulate ranges of values:
1 Determine the expression that results in the raw values being converted
into one of a small set of fixed values.
Each of those values will form a row or column in the crosstab.
2 Specify the expression in the Columns or Rows box in the Crosstab
Definition dialog box.
You choose the box depending on whether you want the columns or rows
to correspond to the range of values.
3 In the Values column, apply the appropriate aggregate function to the
expression.
Example
This is best illustrated with an example.
You want to know how many employees in each department earn between
$30,000 and $40,000, how many earn between $40,000 and $50,000, how
many earn between $50,000 and $60,000, and so on. To do this, you want a
crosstab where each row corresponds to a $10,000 range of salary.