rolledup(X;I)
Returns a boolean value indicating whether or not a particular break column is included for the current row within a rollup tabulation.
Syntax
rolledup(X;I)
Input
Argument | Type | Description |
---|---|---|
X |
integer | A column name
|
I | integer | The break column in question
|
Return Value
Returns an integer value of 1 if the I
'th
break column is rolled up for the current row. Otherwise, returns
0.
<rollup>
element.Example
The following example creates a rollup tabulation of
pub.demo.baseball.batting using the columns lg
,
team
, and lastname
as the break columns. The
<rollup>
element creates an aggregation indicator column named
level
that contains an integer value related to which break columns are
included in the rollup for each row. The column is_rolledup
displays the
results of rolledup(X;I)
, where X
is the indicator column
level and I
is 1, which
refers to the innermost break column, lastname
. This function returns an
integer value of 1 if the lastname
column is
included in the rollup for the current row, and returns 0
otherwise.
<base table="pub.demo.baseball.batting"/>
<tabu label="Tabulation on Batting" breaks="lg,team,lastname">
<rollup ind="level"/>
<tcol source="lg" fun="cnt" label="Count"/>
</tabu>
<sort col="level" dir="down"/>
<willbe name="is_rolledup" value="rolledup(level;1)"/>
Based on the value of the is_rolledup
column, you can see that the
lastname
column is included in the rollup for those rows outlined in
green, but is not included for those outlined in red.