Specifications

CHAPTER 24 DataWindow Expression and InfoMaker Functions
Users Guide 633
About crosstab functions
Although the crosstab functions (CrosstabAvg, CrosstabAvgDec,
CrosstabCount
, CrosstabMax, CrosstabMaxDec, CrosstabMin, CrosstabMinDec,
CrosstabSum, and CrosstabSumDec) behave like aggregate functions, they are
not included on the list because they are for crosstabs only and are designed to
work in the crosstab matrix.
A few restrictions apply to the use of aggregate functions. You cannot use an
aggregate function:
In a filter
In a validation rule
As an argument for another aggregate function
This example demonstrates the use of the
Sum aggregate function.
What you want to do
Using the employee table in the EAS Demo DB as the data source, you create
a report using at least the
Emp_id and the Sex columns. You want the report to
display the number of male employees and female employees in the company.
How to do it
In the summary band in the workspace, add two computed fields to the report
that use the Sum and If functions:
Sum(If(sex = "M", 1, 0))
counts the number of males in your company;
Sum(If(sex = "F", 1, 0))
counts the number of females in your company.
By clicking the Page computed field button, you can also add a Page computed
field in the footer band to display the page number and total pages at the bottom
of each page of the report.
What you get
Here is what the design of the report looks like.