Special Functions

 

Various additional functions are available in crosstabs including. Also see chapter Overview of Functions.

§ Crosstab.Total() defines the value of the corresponding total column of a cell.

§ Crosstab.Value() returns the value of a cell.

§ Crosstab.Cells.Avg() returns the mean value of the cell contents.

§ Crosstab.Cells.Sum() returns the sum of the cell contents.

§ Crosstab.Col$() or Crosstab.Row$() returns the label of the column or the row currently being output..

With this, you can, for example, assign a particular color to the background of a column or row. The following example sets the background color to orange for all cells in a row where the cell descriptor is "Germany":

Cond(Crosstab.Row$()="Germany",LL.Color.Orange,LL.Color.White)

image168_186

Figure 6.54: Coloring a particular row

§ Crosstab.Cells.Max() or Crosstab.Cells.Min() returns the largest or smallest value of the cell contents. With this, you can, for example, emphasize the largest or smallest value of the volume of data or perform calculations. The following example sets the background color of the cell with the largest value to green:

Cond(Crosstab.Value=Crosstab.Cells.Max(),LL.Color.Green,

Cond(Crosstab.Row$()="Germany",LL.Color.Orange,LL.Color.White))

image168_187

Figure 6.55: Coloring a particular cell

§ Crosstab.Col() or Crosstab.Row() returns the index of the column or the row for the cell currently being output. Here, for example, you can set the background color of alternate rows thereby producing a zebra pattern. Example:

Cond(Odd(Crosstab.Row()),LL.Color.LightGray,LL.Color.White)

image168_188

Figure 6.56: Creating a zebra pattern

§ Join$() returns a collection of strings, separated by a particular character. For example, you can output the individual turnover amounts in addition to the total turnover. Example:

Fstr$(Sum(Order_Details.Quantity*Order_Details.UnitPrice),"-##,###,###") + "¶["+ Join$(Fstr$(Sum(Order_Details.Quantity*Order_Details.UnitPrice),"-##,###,###"))+"]"

image168_189

Figure 6.57: Display detailed information