Percent-based Calculated Values in Cross-tables
Percent-based Calculated Values in Cross-tables
Percent-based calculated values can be implemented using SQL calculated fields. For example:
<field name="percent_area" dataType="number" size="6" decimals="0">
<title>Percentage Area</title>
<sql dialect="generic">
sum(area) / (select sum(rm.area) from rm) * 100.0
</sql>
</field>
However, percent-based SQL calculations do not work on Oracle. With V.19.1 and later, you can use sum-percent and count-percent formula fields that do not require custom SQL and work on all databases.
<field name="percent_area" dataType="number" size="6" decimals="0"
baseField="rm.area" formula="sum-percent">
<title>Percentage Area</title>
</field>
Example: