Crosstab (attribute of entity)

From JRapid

Jump to: navigation, search

crosstab is an attribute of entity.



The crosstab attribute creates a cross tabulation using the entity on which it is applied as the base table.

A crosstab groups rows by one property, columns by another, and uses an aggregate function (count, sum etc) of a third property for the table data. The grouping properties are called dimensions.

Crosstabs can be customized at runtime by configuring:

  • Dimensions
  • Filters
  • Decorators
  • Operators

Default values for dimensions can be set using the dimension attribute of property.


   name = NAME
   crosstab = "crosstab"


A Company entity specifies the crosstab attribute, with its city property as the column dimension and active property as the row dimension.

    <entity crosstab="crosstab" label="Company" menu="People" name="Company" order="name">
        <property display="primary" label="Name" name="name"/>
        <property label="Address" name="address" type="text"/>
        <property dimension="row" display="secondary" entity="City" label="City" name="city"/>
        <property dimension="column" display="secondary" label="Active" name="active" type="boolean"/>
        <property display="secondary" label="Load Date" name="loadDate" type="date"/>

    <entity label="City" menu="Places" name="City" order="name">
        <property display="primary" label="City" name="name"/>
        <property display="secondary" label="Active" name="active" type="boolean"/>

The obtained crosstab looks like this.

Crosstab example

Clicking on Configure allows to dynamically change the dimensions.

Configuring crosstab

Setting the loadDate_year and loadDate_month as row dimensions changes the crosstab and displays the following table.

Crosstab example

See also

Personal tools