Aggregate vs Group By in Custom Functions

Aggregate

If your custom function SQL contains aggregated fields, you should add an element for each one, for example:

<sql>
<![CDATA[
sum($1) + sum($2)
]]>
</sql>
<aggregate>$1</aggregate>
<aggregate>$2</aggregate>
In this example, there are two substitution fields, $1 and $2. They are both aggregated in the SQL, so there is an element for each one.

Group By

If your SQL contains non-aggregated expressions, you should add a element that tells yellowfin to group by that expression when necessary, for example:
<sql>
<![CDATA[
$1 + $2
]]>
</sql>
<groupby>$1 + $2</groupby>
In this example, there are two substitution fields again, $1 and $2, but neither of them are aggregated. If you had another field in your report that is aggregated, Yellowfin should group by the whole calculation ($1 + $2) so this is entered in the groupby element.

Is this article helpful?
0 0 0