An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING cla
Hi guys, I have a problem with Report Filters. I have two calculated fields (1 & 2 below). Another calculated field (3) is also present, using the input from previous calculated fields.
I want to use this last calculated field (3) as a filter as well. When I try to enter a value to the filter, I receive below error:
An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.
Calculated field 1: CASE WHEN SUM ( Aantal ) != 0 THEN SUM ( Opbrengst) / SUM ( Aantal) ELSE 0 END
Calculated field 2: CASE WHEN SUM ( Aantal_LY ) != 0 THEN SUM ( Opbrengst_LY ) / SUM ( Aantal_LY) ELSE 0 END
Calculated Field 3: CASE WHEN Calculated field 2 != 0 THEN ( Calculated field 1 - Calculated field 2 ) / Calculated field 2 * 100 ELSE 0 END
Apperantly, it needs to be a "Having" clause instead of "where" when there is an aggregation. But Yellowfin does not convert this "where" to "having" automatically.
Any ideas on how to solve this?